title: Python 3: unable to understand the 2nd iteration
body: <p>Using the below mentioned python code, I am reading the number entered by the user and printing the series.</p>
  
  <pre><code>n=int(input("Enter a number: "))
  for j in range(1,n+1):
      a=[]
      for i in range(1,j+1):
          print(i,sep=" ",end=" ")
          if(i&lt;j):
              print("+",sep=" ",end=" ")
          a.append(i)
      print("=",sum(a))
  </code></pre>
  
  <p>When I run this code, I am seeing the below mentioned output.</p>
  
  <pre><code>RESTART: C:\SKANAKAV\at&amp;t\Python\Aricent_Python\python_scripts\Read a Number 
  n And Print the Series_contdddd\test_exercise.py 
  Enter a number: 2
  1 = 1
  1 + 2 = 3
  </code></pre>
  
  <p>User has entered the number 2 which is 'n'. For the 1st 'for' loop -> j is (1,3) where j has the value 1 now. For the 2nd 'for' loop -> i is (1,2). In the next line it prints '1' and then for the 'if' condition (i 1&lt;1) which is 'false' and hence comes out of the loop and appends i(1) to 'a'.now the final output is printed as 1 = 1.</p>
  
  <p>I am able to understand till this which means the 1st iteration. now here is where I am not able to understand the program flow. it goes back to the 1st for loop where 'j' becomes 2 now.
  a is again an empty list.
  now for the 2nd 'for' loop -> (1,3) -> 'i' is again 1 now.
  Now we print 1 and then get into the 'if' condition (i (1&lt;2) which is 'true' and hence gets into the loop and prints '+'.</p>
  
  <p>Now again 'a' becomes 1 as 'i' is 1.
  going by this, it should print -> 1 + = 1.
  But it prints 1 + 2 = 3.
  Can someone please help me understand this program flow? </p>