title: Find if an input is in a list
body: <p>Trying to get an input from the user (which the computer accepts) and then checks if it is in a list. Afterwards, it starts to play the game. Any advice?</p>
  
  <pre><code>if answer == "2":
      f = open("users.txt", "r")    
      x = str(input("Please enter a valid username: "))
      for line in f:
           usernab = print(line.strip())
           if (x) in (usernab):
                  for x in range(0,5):
                         #Do something.
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
  File "E:/NEA/Project/backup.py", line 20, in &lt;module&gt;
  if (x) in (usernab):
  TypeError: argument of type 'NoneType' is not iterable
  </code></pre>