Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- tina = Turtle()
- def draw_circle(t_name, x, y, r, col):
- t_name.color(col)
- t_name.dot(r*2)
- t_name.penup()
- t_name.goto(x,y)
- t_name.pendown()
- draw_circle(tina,-25, 150, 200, "blue")
- draw_circle(tina, -75, 100, 150, "pink")
- draw_circle(tina, 10, 100, 50, "red")
- draw_circle(tina, 50, 100, 50, "red")
- from turtle import*
- from random import*
- def randomcolour():
- colormode(255)
- red = randint(0, 255)
- green = randint(0, 255)
- blue = randint(0, 255)
- color(red, green, blue)
- def randomplace():
- penup()
- x = randint(-100, 100)
- y = randint(-100, 100)
- goto(x, y)
- pendown()
- def random_heading():
- setheading(randint(1, 360))
- shape("turtle")
- for i in range (30):
- randomcolour()
- randomplace()
- random_heading()
- stamp()
- clear()
- setheading(0)
- def drawrectangle():
- randomcolour()
- randomplace()
- speed(0)
- hideturtle()
- length =randint(10, 100)
- height=randint(10, 100)
- begin_fill()
- forward(length)
- right(90)
- forward(height)
- right(90)
- forward(length)
- right(90)
- forward(height)
- right(90)
- end_fill
- clear()
- setheading(0)
- for i in range(20):
- drawrectangle()
- turtle=Turtle()
- def draw_circle():
- randomcolour()
- randomplace()
- speed(0)
- hideturtle()
- radius=randint(1,200)
- dot(radius)
- end_fill
- for i in range(50):
- draw_circle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement