Answers for "write a program to draw this. assume the innermost square is 20 units per side, and each successive square is 20 units bigger, per side, than the one inside it"

0

2. Write a program to draw this. Assume the innermost square is 20 units per side, and each successive square is 20 units bigger, per side, than the one inside it.

import turtle
wn = turtle.Screen()
wn.bgcolor("lightgreen")
tess = turtle.Turtle()

def draw_square(t,size):
    for i in range(4):
        tess.forward(size)
        tess.left(90)

size = 20
for j in range(3):
   tess.pensize(3)
   draw_square(tess,size)
   size = size + 20
   tess.penup()
   tess.goto(-20, -20)
   tess.pendown()

wn.mainloop()
Posted by: Guest on June-19-2021

Code answers related to "write a program to draw this. assume the innermost square is 20 units per side, and each successive square is 20 units bigger, per side, than the one inside it"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language