title: Python += with a list and a tuple
body: <p>I saw someone wrote an interesting python line online, but couldn't understand why it works. So we can try the following lines in python interpreter:</p>
  
  <pre><code>s=[1]
  s=s+(1,-1)
  </code></pre>
  
  <p>This will result in an error "TypeError: can only concatenate list (not "tuple") to list". But if done in another way:</p>
  
  <pre><code>s=[1]
  s+=(1,-1)
  </code></pre>
  
  <p>will result in s = [1,1,-1]</p>
  
  <p>So I used to thought x=x+y is equivalent to x+=y, can someone tell me how they are different and why the second way works? Thanks in advance.</p>