title: Python a, b = b, a +b
body: <p>This is my first question and I started to learn Python.
  Is there a difference between: </p>
  
  <pre><code>a, b = b, a + b
  </code></pre>
  
  <p>and</p>
  
  <pre><code>a = b
  b = a + b
  </code></pre>
  
  <p>When you write it in below example it shows different results.</p>
  
  <pre><code>def fib(n):
      a, b = 0, 1
      while a &lt; n:
          print(a, end=' ')
          a, b = b, a + b
      print()
  fib(1000)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def fib(n):
      a, b = 0, 1
      while a &lt; n:
          print(a, end=' ')
          a = b
          b = a + b
      print()
  fib(1000)
  </code></pre>