Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- # Draw 8 equal figures together, which in each iteration
- # turn to the left about 10 degrees.
- turtle = Turtle()
- # Start painting the fill
- turtle.begin_fill()
- # Initialize the degrees to 0
- degrees = 0
- # Stroke speed
- turtle.speed(15)
- # To avoid repeating the orders I use the for loop
- for x in range(1, 8):
- for x in range(0, 4):
- turtle.color("blue")
- # tells the virtual pencil to move 150 pixels forward
- turtle.forward(150)
- turtle.color("green")
- # tells the virtual pencil to turn 90 degrees to the left
- turtle.left(190)
- # turn to the left about 10 degrees
- turtle.left(degrees + 10)
- # Finish painting the fill
- turtle.end_fill()
- elena = Turtle()
- elena.penup()
- elena.goto(-150,-90)
- elena.left(90)
- elena.goto(-75,-175)
- elena.color("purple")
- elena.write("My Star", None, None, "16pt bold")
- elena.goto(-75,-175)
Add Comment
Please, Sign In to add comment