Python Turtle: Function to draw left nested squares
<p>I am trying to write a function to draw nested squares. The picture must consist of 10 squares. The outermost is 200 wide, each inner one is 20 smaller. They are on the left and top 5 apart. It needs to start with reset() and hideturtle() and use loops. I am having trouble with setting the positioning for the drawing of each square, since the turtle needs to move to the right 5 pixels and down 5 pixels for each one. The function should return an image that looks like the one below. This is what I have so far: </p>

<pre><code>def ForTheSquares(t, center, side):
    xPt =center[0]+(side-(side-5)) 
    yPt = center[0]-(side-(side-5))
    t.up()
    t.goto(xPt, yPt)
    t.down
    for i in range(4):
        t.forward(side)
        t.right(90)


def NestSquares(t, center, side):
    if side &lt;1:
        return
    ForTheSquares(t, center, side)
    NestSquares(t, center, side-20)


def main():
    t=turtle.Turtle()
    NestSquares(t, [0,0], 200)
</code></pre>

<p>This is my goal:</p>

<p><img src="https://i.stack.imgur.com/BfQqj.png" alt="Nested Squares Goal"></p>

<p>Any help would be very much appreciated! I am new to coding and Python. </p>