Day -16 Turtle flower
import turtle
j = turtle.Turtle()
j.shape('turtle')
my_screen = turtle.getscreen()
def my_turtle(s):
j.left(60)
j.forward(s)
j.left(30)
j.circle(s/4, 180)
j.left(180)
j.circle(s/4, 180)
j.left(30)
j.forward(s)
j.left(60)
n = 1
while n!=7:
if n%2==0:
my_screen.bgcolor("white")
j.color("red")
else:
my_screen.bgcolor("black")
j.color("blue")
s = 100
while s!=300:
j.speed(10)
my_turtle(s)
s = s+50
j.left(60)
n+=1
my_screen.exitonclick()
Comments
Post a Comment