Is it in the list?

Write code · Basic · §5.6 Is it in there?

Store True in found if x is in the list nums, and False if it is not. Write it in one line with the in operator.

Starter code

nums = [4, 5, 6, 7, 8]
x = 5

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.