Coding Club

Python turtle and tkinter

Six projects in Python, the language professional programmers use every day. The turtle draws as you code, so you see every line work, and tkinter lets you build real apps with windows and buttons.

Six days, six projects

One small project a session. Each one is a numbered list of steps with a picture of what to click and what you should see, then tests and stretch challenges for anyone who finishes early.

Day 1Shape ShifterTeach a turtle to draw a square, a triangle and a star, then fill them with colour.
Day 2Spiral PartyMake the turtle spin rainbow spirals that grow and twist across a black sky.
Day 3Build a TownWrite your own turtle commands, called functions, and use them to build a street of houses.
Then the race runs, and this time red won. Every race is different!
Day 4Turtle RaceLine up four racing turtles, let random numbers decide who wins, and guess the winner first.
Day 5Click CounterBuild a real window with a button and a counter, and see how fast you can click.
Day 6Quiz MasterMake a quiz app with questions in a list, answer buttons, a score and a pop up box at the end.

Get set up before day 1

You will need

  • A computer with Thonny (free from thonny.org) or IDLE
  • A folder to save your programs in
  • No account and no internet once Thonny is installed
  1. Setup step 1: Open Thonny

    Thonny is a free Python editor made for learning. On a school computer, click Start, type Thonny and press Enter. At home, download it free from thonny.org.

    The big white area at the top is the editor, where you write your program. The area underneath is the Shell, where Python shows anything your program prints.

    Thonny: the editor at the top, the Shell underneath.
  2. Setup step 2: Make a new file and save it

    Click New, then Save. Choose a folder you can find again, such as your Documents folder or your school drive, type a name for the file, such as hello.py, and click Save.

    Click New (1), then Save (2).
    Type the name of the file and click Save.
    Watch out Never call a file turtle.py or tkinter.py. Python would load your file instead of its own turtle or tkinter, and nothing would work.
  3. Setup step 3: Write a program and run it

    Type this line into the editor, exactly as it is. Then click the green Run button, or press F5. The Shell shows what the program prints.

    Python
    print("Hello, Coding Club!")
    Click Run: the Shell says Hello, Coding Club!
    Tip Thonny saves your file every time you press Run, so you never lose your work.
  4. Setup step 4: No Thonny? Run it on this page

    Every turtle and tkinter program on these pages has a Run it here button, which runs it in your browser: handy at home, or to check what a step should do.

    IDLE, which comes with Python, works too. Open it from the Start menu, click File then New File, type your program, save it, and press F5 to run it.

Notes for the teacher

Before the first session

  1. Check that Thonny is installed on the club's computers. It is free from thonny.org and comes with its own Python, so nothing else is needed. If installing is not possible, IDLE, which comes with every Python for Windows, works for all six projects.
  2. Make sure students can save to a folder they can find again, such as a Coding Club folder on the school drive.
  3. Every turtle and tkinter program on these pages has a Run it here button that runs it in the browser, so students can also work at home without installing anything.

How the six projects build up

Days 1 to 4 use the turtle: sequence and loops, then variables and lists, then functions with parameters, then random numbers, while and if. Days 5 and 6 use tkinter for event driven apps with buttons. Each day reuses something from the day before, but every project starts from an empty file, so a student who missed a session can still join in.