#------------------------------------------------------------------------------ # TurtleLoop2.py #------------------------------------------------------------------------------ import turtle n = int(input('Enter the number of sides: ')) wn = turtle.Screen() # Set up the window and its attributes wn.bgcolor("lightgreen") wn.title(str(n)+"-gon") bob = turtle.Turtle() # Create bob the turtle to draw things bob.color("blue") # pen color bob.pensize(2) for i in range(n): bob.forward(840/n) bob.left(360/n) wn.mainloop()