Created
November 15, 2020 20:41
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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