Skip to content

Instantly share code, notes, and snippets.

@mykelangelo
Created November 15, 2020 20:41
Show Gist options
  • Save mykelangelo/eae8ceb50eec9d39310511cdc361458b to your computer and use it in GitHub Desktop.
Save mykelangelo/eae8ceb50eec9d39310511cdc361458b to your computer and use it in GitHub Desktop.
"Python for Kids" (by Jason R. Briggs), chapter 11 - drawing circles and squares
import turtle
import random
t = turtle.Pen()
def my_circle(red, green, blue):
t.color(red, green, blue)
t.begin_fill()
t.circle(15)
t.end_fill()
def my_square(side):
for x in range(0, 4):
t.forward(side)
t.left(90)
t.speed(10)
#
# while True:
# my_square(30)
# my_circle(random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1))
# t.up()
# t.forward(35)
# t.down()
#
while True:
my_square(random.uniform(0, 250))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment