title: How Can I Fill These Squares in Turtle - Python
body: <p>I am trying to fill the color in these squares:</p>
  
  <p><img src="https://i.imgur.com/kRGgR.png" alt="http://i.imgur.com/kRGgR.png"></p>
  
  <p>Right now the turtle only fills the corners of theses squares, not the entire square.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import turtle
  import time
  import random
  
  print ("This program draws shapes based on the number you enter in a uniform pattern.")
  num_str = input("Enter the side number of the shape you want to draw: ")
  if num_str.isdigit():
      squares = int(num_str)
  
  angle = 180 - 180*(squares-2)/squares
  
  turtle.up
  
  x = 0 
  y = 0
  turtle.setpos(x,y)
  
  
  numshapes = 8
  for x in range(numshapes):
      turtle.color(random.random(),random.random(), random.random())
      x += 5
      y += 5
      turtle.forward(x)
      turtle.left(y)
      for i in range(squares):
          turtle.begin_fill()
          turtle.down()
          turtle.forward(40)
          turtle.left(angle)
          turtle.forward(40)
          print (turtle.pos())
          turtle.up()
          turtle.end_fill()
  
  time.sleep(11)
  turtle.bye()
  </code></pre>
  
  <p>I've tried moving around <code>turtle.begin_fill()</code> and <code>end_fill()</code> in numerous locations with no luck… Using Python 3.2.3, thanks.</p>