title: Python: while loop within a while loop
body: <p>I'm wondering why this code does not work.</p>
  
  <pre><code>loop = -10
  loop2 = -10
  while loop &lt;= 10:
      while loop2 &lt;= 10:
          if current_block:
              block = turtle.Turtle()
              block.shape("square")
              block.color("white")
              block.shapesize(stretch_wid=0.85, stretch_len=0.85)
              block.penup()
              block.goto(loop*20, loop2*20)
          loop2 += 1
      loop += 1
  </code></pre>
  
  <p>What I want to do is to create a 20x20 grid of squares centered at (0,0).
  Right now, only a line of squares are created at x-200</p>