title: Python range is printed twice
body: <p>I am currently working on a project (In Python 2.7), and ran into a problem when the <code>for</code> values for <code>range()</code> was printed twice.
  I minimized a lot of the part I am talking about, so if just assume that there are other parts in my code.</p>
  <p>So, basically, I have a 5 by 5 board, and depending on <code>case1</code> and <code>case2</code>, I am copying the board with <code>list()</code> and making alters to it. Then, I want to have a column of numbers stating the row numbers, so that the output will be something like:</p>
  <pre><code>1     O O O O O
  2     O O O O O
  3     O O O O O
  4     O O O O O
  5     O O O O O
  </code></pre>
  <p>for <code>case1</code> and <code>case2</code>.</p>
  <p>I have:</p>
  <pre><code>board = []
  # Creating board
  for i in range(5):
    board.append([&quot;O&quot;] * 5) 
  case1 = True
  case2 = True
  
  if case1 == True:
    board1 = list(board) #Making duplicate of board
    # I took out a lot of the code making alterations to board1
    
    for i in range(5):
      board1[i].insert(0, str(i + 1) + &quot;    &quot;)
  
  if case2 == True:
    board2 = list(board) #Making duplicate of board
    # I took out a lot of the code making alterations to board2
    
    for i in range(5):
      board2[i].insert(0, str(i + 1) + &quot;    &quot;)
  
  #Printing the boards
  for i in range(5):
    print &quot; &quot;.join(board1[i])
  
  print &quot;\n\n&quot; #Just a gap
  
  for i in range(5):
    print &quot; &quot;.join(board2[i])
  </code></pre>
  <p>However, the output is:</p>
  <pre><code>1     1     O O O O O
  2     2     O O O O O
  3     3     O O O O O
  4     4     O O O O O
  5     5     O O O O O
  </code></pre>
  <p>for each <code>board1</code> and <code>board2</code>. I get the expected result when I take out everything concerning <code>case2</code>, however, with my current code, it is printing the range() for the rows printing twice.</p>
  <p>I would like to know if there are ways to solve this problem.</p>
  <p>Sorry if my wording is very unclear. I would be thankful if somebody to edited the question/title for more clarity.</p>