Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python3
- #python 101 Turtle art
- #Some code remixed from Raspberry Pi Modern Art project
- from turtle import *
- from random import *
- tricky = Turtle()
- def randomcolour(t_name): # random change to the colour of the turtle
- colormode(255)
- red = randint(0, 255)
- green = randint(0, 255)
- blue = randint(0, 255)
- t_name.color(red, green, blue)
- def draw_circle(t_name, x, y, r): # draw a circle using the dot library function
- randomcolour(t_name) # call random colour
- t_name.penup()
- t_name.goto(x,y)
- t_name.dot(r*2)
- t_name.pendown()
- draw_circle(tricky,0,100,200)
- randomcolour(tricky)
- tricky.pensize(4)
- tricky.forward(200)
- draw_circle(tricky,50,100,75)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement