title: Python - If "a" or "b"
body: <p>I have this (simplified):</p>
  
  <pre><code>    foo = input("Test")
      if foo is "a" or "b":
          print("Test")
  </code></pre>
  
  <p>This returns Test for everything that the user inputs, while those work and only return when <code>a</code> or <code>b</code> is given.</p>
  
  <pre><code>    foo = input("Test")
      if foo is "a" or foo is "b":
          print("Test")
  </code></pre>
  
  <p>-</p>
  
  <pre><code>    foo = input("Test")
      if foo in ("a" or "b"):
          print("Test")
  </code></pre>
  
  <p>Why does the first one not work? </p>
  
  <p>I can only guess that the first one actually checks if <code>foo == "a"</code>, but not if <code>foo == "b"</code>, and that the <code>or "b"</code> part always returns <code>True</code> - but why?</p>