Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle as t
- import random
- tim = t.Turtle()
- t.colormode(255)
- def random_color():
- r = random.randint(0, 255)
- g = random.randint(0, 255)
- b = random.randint(0, 255)
- color = (r, g, b)
- return color
- ########### Challenge 5 - Spirograph ########
- def draw_spirograph(size_of_gap):
- for _ in range(int(360 / size_of_gap)):
- tim.color(random_color())
- tim.circle(100)
- tim.setheading(tim.heading() + size_of_gap)
- draw_spirograph(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement