Free Python Course for Kids: 6 Short Lessons, From First Line to First Game

This is a free mini-course for kids who want to try Python, one of the world's most popular programming languages. It suits ages 10 and up who can type comfortably. Each lesson takes 10 to 15 minutes. Type the code yourself rather than copying and pasting: that's how it sticks.
Before you start: get Python for free
You don't need to buy anything.
- Easiest: install Thonny, a free Python editor made for beginners (search "Thonny Python" and download it for Windows, Mac or Linux). Python comes built in.
- No install? Use any free online Python editor in your browser.
Type the code into the editor, press Run, and watch the output.
Lesson 1: Your first program
print("Hello! My name is Aarav.")
print("I am learning Python.")
print tells Python to show text on the screen. Text goes inside quotes.
Try it: change the name to yours, and add a third line about your favourite game.
Lesson 2: Variables are labelled boxes
name = "Aarav"
age = 11
print("Hi", name)
print("Next year you will be", age + 1)
A variable stores a value so you can use it later. name holds text and age holds a number, and Python can do maths with numbers.
Try it: make a variable called pets with the number of pets you have, then print how many you'd have if you got two more.
Lesson 3: Asking the user a question
name = input("What is your name? ")
print("Nice to meet you,", name)
year = int(input("What year were you born? "))
print("This year you turn", 2026 - year)
input waits for the person to type something. It always gives back text, so we wrap it in int(...) to turn it into a whole number before doing maths.
Try it: ask for someone's favourite food and reply with a sentence about it.
Lesson 4: Making decisions with if
score = int(input("What was your test score? "))
if score >= 90:
print("Amazing!")
elif score >= 60:
print("Good job, keep going.")
else:
print("Let's practise together.")
if, elif ("else if") and else let a program choose what to do. The indentation (the spaces at the start of a line) matters in Python: it shows which lines belong to each choice.
Try it: write a program that asks for the temperature and says "Wear a jacket" if it's below 18.
Lesson 5: Repeating with loops
for number in range(1, 6):
print(number, "x 7 =", number * 7)
A for loop repeats code. range(1, 6) counts 1, 2, 3, 4, 5, so this prints the first five lines of the 7 times table.
countdown = 5
while countdown > 0:
print(countdown)
countdown = countdown - 1
print("Lift off! ๐")
A while loop repeats as long as something is true.
Try it: print the full 12 times table, from 1 to 10.
Lesson 6: Build a number-guessing game
Now put everything together.
import random
secret = random.randint(1, 20)
guesses = 0
print("I'm thinking of a number between 1 and 20.")
while True:
guess = int(input("Your guess: "))
guesses = guesses + 1
if guess < secret:
print("Too low!")
elif guess > secret:
print("Too high!")
else:
print("You got it in", guesses, "guesses! ๐")
break
What's new here:
import randomloads Python's built-in random-number tools.random.randint(1, 20)picks a secret number.while Trueloops forever, untilbreakstops it when you win.
Challenges:
- Give the player only 5 guesses, then reveal the number.
- Ask the player to choose the difficulty (1 to 20, or 1 to 100).
- Keep a best score across several rounds.
What to learn next
You've just used variables, input, decisions, loops and a library, the same building blocks professional programmers use every day. Good next steps:
- Functions: write your own reusable commands.
- Lists: store many values, like a high-score table.
- Windows and buttons: build apps with Python's built-in Tkinter library.
If your child enjoyed this and wants a live teacher to go further, see our Python course, or try a free trial class. New to coding and under 10? Start with our free Scratch course instead.
Written by
CodingChamp Curriculum Team
Trainers and curriculum designers
Written by the team that designs and teaches CodingChamp's live 1:1 classes in Scratch, Python, web development and AI for school students, drawing on what we see in classes every week. About CodingChamp
