Code Lab: free coding puzzles for kids and teens
Program Sam to reach the safe. Tap arrows, loops, if blocks and functions, see every program as real Python, and get help that explains exactly what went wrong.
8 zones, from first steps to Python
👣 Step by Step
Algorithms and sequence · Ages 4+ · 6 levels
Children learn that computers follow instructions exactly, in order. Ask: “What do you think will happen?” before they press Run.
🐞 Fix the Bug
Debugging · Ages 5+ · 5 levels
Debugging means finding and fixing mistakes. Getting it wrong is part of the process, so praise the fixing, not just the first try.
🔁 Loop It
Repetition (loops) · Ages 7+ · 6 levels
Loops (also called repetition or repeat blocks) save writing the same thing over and over. Spot loops in real life: “stir 10 times”, “brush each tooth”.
🔀 If This, Then That
Selection (if / else) · Ages 8+ · 4 levels
Selection means the program makes a decision: if something is true, do one thing, else do another. Real life: “If it’s raining, take a coat, otherwise wear sunglasses.”
🧩 Make Your Own Move
Functions (procedures) · Ages 10+ · 3 levels
Functions (sometimes called procedures) give a name to a set of steps, so you can reuse them. Real life: a recipe that says “make the sauce” instead of listing every step again.
🏗️ Master Coder
Combining loops, ifs and functions · Ages 11+ · 6 levels
This is “nesting” and “decomposition”: breaking a big problem into a pattern, then a pattern inside that pattern. It’s how real programmers keep code short and readable.
🐍 Read Real Code
Text code (Python) · Ages 11+ · 10 questions
From about age 11, schools move from blocks to typed code, usually Python. Reading code and predicting what it does is one of the best ways to learn it.
🧑💻 Python Pro
Lists, nested loops and logic (Python) · Ages 13+ · 10 questions
These match what students meet at GCSE Computer Science: lists and indexes, nested loops, dictionaries, string slicing, modulo, Boolean logic and spotting off-by-one bugs.
Never stuck for long
- Sam explains bugs: which block went wrong, what it made Sam do, and which ways were open.
- Step by step: run one move at a time and see a list of everything Sam did.
- Hints that read your code, then an answer with an explanation if you still need it.
- Read Real Code explains why each wrong answer is wrong, with a line-by-line walk-through.
New to coding words? Read coding in plain English.