import turtle
t = turtle.Turtle()
t.shape('turtle')
t.pensize(2)
t.penup()
t.goto(-50, -50)
t.pendown()
t.left(90)
turtle.bgcolor('grey')
# t.speed(0)
def square(x):
for i in range(4):
t.forward(x)
square(200)
t.color('white')
square(150)
t.color('lavender')
square(100)
t.color('black')
square(50)
t.hideturtle()
turtle.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import turtle
t = turtle.Turtle()
t.shape('turtle')
t.pensize(2)
t.penup()
t.goto(-50, -50)
t.pendown()
t.left(90)
turtle.bgcolor('grey')
# t.speed(0)
def square(x):
for i in range(4):
t.forward(x)
t.left(90)
square(200)
t.color('white')
square(150)
t.color('lavender')
square(100)
t.color('black')
square(50)
t.hideturtle()
turtle.mainloop()