Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # t_offset_rotate.py
- from turtle import Turtle, Screen
- from itertools import cycle
- ANGLE = 8
- colors = ["orange", "yellow", "green", "blue"]
- def offset_rotate(turtle, radius, color_names):
- colors = cycle(color_names)
- for _ in range(360 // ANGLE):
- turtle.color(next(colors))
- turtle.circle(radius)
- turtle.left(ANGLE)
- tu = Turtle(visible=False)
- tu.speed("fastest")
- offset_rotate(tu, 120, colors)
- screen = Screen()
- screen.exitonclick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement