🐍 Python for kids
Python is the friendliest first language, and this is all of it a child needs: printing, variables, if, loops, lists, dictionaries, functions, files and classes, one bite-sized lesson at a time.
- 31 units
- 160 lessons
- 868 exercises
- Units 1–2 free
- Ages 8–15
How this track is kept honest
Every example runs real Python in the browser — CPython itself, compiled to WebAssembly — so what a lesson says it prints is what Python prints. Each sample is re-run against a real python3 before it ships, and a lesson whose answer no longer matches cannot be merged.
Written for ages 8–15 with no experience at all. Start here if you have never written a line of code.
How it starts
print tells the computer to say something out loud on the screen. Put the words inside quotes and inside the round brackets.
The full Python syllabus
31 units and 160 lessons, in the order they are played. Each unit has a page of its own with every explanation in it, the code samples and what they print, and a few questions to try.
Unit 1: Hello, Python
Make the computer talk
- Printing
- Boxes for Stuff
- Words & Text
- Neat Printing
- Greeting Machine
Unit 2: Making Choices
Teach your code to decide
- True or False
- If / Else
- And, Or, Not
- Bug Squashing
- Bouncer Bot
Unit 3: Loops & Lists
Do things again and again
- Repeating
- Keep Going Until
- Lists
- Functions
- Sending an Answer Back
- Guessing Game
Unit 4: Playing with Numbers
Remainders, dice and patterns
- Leftovers
- Number Helpers
- Roll the Dice
- Loops Inside Loops
- Dice Duel
Unit 5: Words, Deeper
Pull text apart and rebuild it
- Letter by Letter
- Cutting Slices
- String Powers
- Looping Over Letters
- Word Wizard
Unit 6: Lists & Dictionaries
Collections that grow
- Growing Lists
- Asking Lists Questions
- Dictionaries
- Looping Over Dictionaries
- Pet Shop
Unit 7: Talking to the Player
Programs that ask questions
- Ask a Question
- Changing Types
- When Things Go Wrong
- Keep Asking
- Quiz Master
Unit 8: Smarter Functions
Defaults, scope and recursion
- Ready-Made Answers
- More Than One Answer
- Where Names Live
- Functions That Call Themselves
- Function Workshop
Unit 9: Toolboxes
Borrowing code others wrote
- Borrowing Tools
- The Maths Toolbox
- Dates
- Counting Days
- Toolbox Master
Unit 10: Sets & Pairs
No repeats, and looping two at a time
- No Repeats Allowed
- Comparing Sets
- Counting As You Go
- Two Lists at Once
- Set Master
Unit 11: Patterns & Data
match, JSON and finding text
- Matching Cases
- Saving Data as Text
- Finding Patterns
- Checking and Changing
- Pattern Master
Unit 12: Your Own Types
Building things with classes
- Blueprints
- Things That Do Things
- Printing Nicely
- Lots of Objects
- Class Master
Unit 13: Families of Objects
Passing abilities down
- Passing Things Down
- Calling the Parent
- Changing Your Mind
- Same Word, Different Action
- Family Master
Unit 14: Keeping Things Safe
Sharing, hiding and guarding
- Shared by Everyone
- Methods on the Class
- Hands Off
- Properties
- Classes Inside Classes
- Safekeeping Master
Unit 15: Files
Saving things that last
- Writing to a File
- Reading it Back
- Adding More
- Checking and Deleting
- File Master
Unit 16: Functions as Things
Passing functions around
- Functions Are Values Too
- Tiny Functions
- Map and Filter
- As Many As You Like
- Functions That Build Functions
- Decorators
- Function Wizard
Unit 17: Comprehensions
Building lists in one line
- Lists in One Line
- Choosing As You Build
- Counting Things
- Dictionaries With a Backup Plan
- Comprehension Master
Unit 18: When Things Break
Raising and handling problems
- Raising the Alarm
- Else and Finally
- The Family of Problems
- Your Own Kind of Problem
- Problem Master
Unit 19: Making Your Own Loops
Iterators, generators and promises
- How For Loops Really Work
- The Easy Way: yield
- Promising a Method Exists
- Loop Master
Unit 20: Folders & Paths
Finding your way around
- Paths as Objects
- Making Folders
- Looking Inside
- Folder Master
Unit 21: Stacks & Queues
Rules about which end you touch
- Boxes in a Row
- Stacks
- Stacks at Work
- Queues
- Stack & Queue Master
Unit 22: Linked Lists
Chains of boxes
- Nodes and Chains
- Walking the Chain
- Adding Links
- Finding and Removing
- Chain Master
Unit 23: Hash Tables
How dictionaries really work
- Turning Words Into Numbers
- Buckets
- When Two Land Together
- Hash Master
Unit 24: Trees
Branching structures
- Branches
- Walking a Tree
- Trees That Sort Themselves
- Searching Fast
- Tree Master
Unit 25: Balanced Trees
Keeping a tree from leaning
- When a Tree Falls Over
- Straightening It Out
- Fixing As You Go
- Balance Master
Unit 26: Graphs
Maps, friends and finding paths
- Dots and Lines
- Spreading Out
- Going Deep
- Finding a Way Through
- Graph Master
Unit 27: Searching
Finding things, slowly and quickly
- One at a Time
- Counting the Cost
- Splitting in Half
- Why Halving Wins
- Search Master
Unit 28: Sorting
Seven ways to put things in order
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Counting Sort
- Radix Sort
- Sorting Master
Unit 29: Graph Algorithms
Costs, order and circles
- Roads Have Lengths
- Dijkstra's Algorithm
- Doing Things in Order
- Going in Circles
- Graph Algorithm Master
Unit 30: Recursion Deeper
Problems inside problems
- The Recursive Recipe
- When Recursion Explodes
- Towers of Hanoi
- Every Possibility
- Backtracking
- Recursion Master
Unit 31: Dynamic Programming
Never solve the same thing twice
- Remembering Answers
- Building From the Bottom
- Counting the Ways
- What to Take
- Comparing Two Words
- DP Master
Other things to learn
- ✨ JavaScript for kids
The language of websites. Try it after Python.
- ⚙️ C programming for kids
How computers really work. Read, predict and reason about real C.
- 🚀 C++ for kids
C with the sharp edges filed off. Powers most games.
- 🔌 Digital logic for kids
Start with one tiny switch. Finish with a working computer.
- 🌱 Git and version control for kids
Save your work forever, and share it.
- 🐧 Linux and the command line for kids
Drive a whole computer by typing.
- 🔢 Problem-solving maths for kids
Powers, shapes, chances and proof — the way problem solvers see them.
- 🤖 AI and machine learning for kids
Teach a computer to learn — with nothing but adding and multiplying.
- 🤖 Robotics coding for kids
Write code that drives a machine around a room.
- 🏁 Competitive programming for kids
Win the race. The algorithms that beat the clock.