title: Why is this python if statement not equal to true?
body: <p>I was going over an assignment, and came across something that confused me, as am I not crazy good with python.  Here is the code. </p>
  
  <pre><code>def main():
  
  
      list = [1,2]
      x = 2
  
      if (x in list == True):
         print("hi")
  
      if (x in list):
         print("Why does this proc?")
  
  main()
  </code></pre>
  
  <p>I believed the output would be both, but the output is only the second if statement.  I know that in C, if you had something like</p>
  
  <pre><code>if (x = 6)
  </code></pre>
  
  <p>That since there is only one '=' that x is now equal to 6. (As its read, if (), x = 6).</p>
  
  <p>Is something similar happening to this python code?  Is it checking 'list == true' first, then from there checking about x being in list?</p>
  
  <p>Any insight would be greatly appreciated!</p>