# Arup Guha
# 9/22/2020
# Nesting Squares

import turtle

# Units per increase in each square.
PIXELSTEP = 10

# Get the # of squares.
n = int(input("How many squares do you want?\n"))

# Set heading so that turtle is headed left, not right.
turtle.left(180)

# This does exactly n squares, one for each multiple of PIXELSTEP
for pos in range(PIXELSTEP, PIXELSTEP*(n+1), PIXELSTEP):

    # Move without drawing to top left square corner.
    turtle.penup()
    turtle.setpos(pos, pos)

    # Get ready to draw.
    turtle.pendown()

    # We draw a square by repeating these steps 4 times.
    # Note the use of a DIFFERENT loop variable.
    # pos stays the same the whole time this loop runs.
    for side in range(4):
        turtle.forward(2*pos)
        turtle.left(90)

