title: Python: Input verification for checking if a number is in a list
body: <p>This just loops infinitely. Even if I enter something like 10. I'm still a Python noob, sorry for the dumb question.</p>
  <pre><code>number_list = [10, 20, 30, 40]    
  number = input(&quot;Enter a number: &quot;)
  while number not in number_list:
      number = input(&quot;Not a valid number, try again: &quot;)
  print(number)
  </code></pre>