Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- import random
- bgcolor("black")
- speed(0)
- colors = ["red", "orange", "yellow", "green", "blue", "purple", "white"]
- shapes = ["turtle", "circle", "square", "triangle", "classic"]
- # Function to draw a colorful random shape
- def draw_random_shape():
- color(random.choice(colors))
- shape(random.choice(shapes))
- for _ in range(36):
- forward(20)
- left(10)
- # Draw a colorful rotating spiral of random shapes
- for _ in range(12):
- draw_random_shape()
- right(30)
- # Draw a funny face with eyes and a smile
- penup()
- goto(0, -200)
- pendown()
- color("yellow")
- begin_fill()
- circle(200)
- end_fill()
- penup()
- goto(-60, 80)
- pendown()
- color("black")
- begin_fill()
- circle(30)
- end_fill()
- penup()
- goto(60, 80)
- pendown()
- begin_fill()
- circle(30)
- end_fill()
- penup()
- goto(-80, -50)
- pendown()
- width(10)
- right(90)
- circle(80, 180)
- hideturtle()
- done()
Advertisement
Add Comment
Please, Sign In to add comment