Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- import random
- import time
- tina = Turtle()
- # function to draw circle
- def draw_circle(using,r,colr,x,y):
- using.penup()
- using.goto(x, y)
- using.pendown()
- using.dot(r * 2, colr)
- # Lets draw 5 circles on screensize
- for x in range(5):
- # co-ordinates
- a = random.randrange(-300,300, step=10)
- b = random.randrange(-300, 300, step = 10)
- # random colour
- clr = random.choice(["red", "blue", "green", "yellow"])
- # draw it
- draw_circle(tina,50, clr, a, b)
- # take a brief pause
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement