1) What do I need to do?
π― Your mission: Your showcase!
Build your own racing game or screen-saver. Make it yours β new colours, shapes, more racers, a scoreboard, a finish message...
It must use turtle, random, and a loop, and draw lots on the screen.
2) What do I need to know?
Idea 1: Hero turtle race
Make a list of turtles, line them up, then loop: each one moves a random amount. The first past the finish line wins!
Watch how the code uses lists, loops, random, if and while β everything you've learned.
π§° Your toolkit for this mission
Everything you need to know to finish this lesson on your own:
Turtle setup
Import, make a screen and turtles.
How to write it: import turtle, t = turtle.Turtle().
import turtle t = turtle.Turtle()
Random movement
Race turtles move a random amount each turn.
How to write it: Use random.randint inside a loop.
for i in range(50):
t.forward(random.randint(1, 10))Screen-saver patterns
Loops + turns + colours make patterns.
How to write it: Change colour with random.choice each loop.
for i in range(36):
t.color(random.choice(["red", "blue", "gold"]))
t.circle(80)
t.right(10)Jump without drawing
Move to a start position.
How to write it: t.penup(), t.goto(x, y), t.pendown().
t.penup() t.goto(-200, 0) t.pendown()
Think about it
Look at this code. What happens next, and why? Say it in your own words.
if racer.xcor() >= 150:
winner = racerWatch & explore βΆ
Power-up: Idea 1: Hero turtle race
See it happen
1 / 3colours = ["red", "blue", "green"]
Create a turtle for each colour, using a list and a loop.
3) Run the code & terminal output
Press βΆ RUN and your program's messages appear here!


Captain Py
Our next adventure is yours to create.
