Patterns and loops
Spot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.
Open it in the simulatorThe habits behind the code, right after Python from zero: break problems down, spot patterns, read flowcharts, plan in pseudocode, trace by hand and debug, then build a sorting robot that shows its work in lights.
0 of 7 done
7 lessons in 4 chapters, about 5 hours on a simulated Raspberry Pi 4 Model B. Free, in your browser, every step checked by the simulator.
Spot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.
Open it in the simulatorPlan in plain words before you write Python: turn pseudocode into code line by line to find the hottest of a day's hull temperatures, then the average and the hot hours, check your work against Python's built-ins, and raise an alarm.
Open it in the simulatorDebug like a programmer, one bug at a time: predict what a recipe program should print, compare it with what it does, and fix a scaling formula upside down, a loop that skips the last step, two steps in the wrong order, and an egg count that rounds the wrong way.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Break a problem into parts and find what repeats.
Decomposition: take a launch that is one long list of instructions, split it into named parts, give the parts inputs so one piece does many jobs, let a part answer GO or NO GO, and light the answer on the Pi.
0 of 5 steps
Spot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.
0 of 5 steps
Flowcharts and pseudocode: the program drawn and written in words first.
Read a flowchart and write the code it draws: boxes in a row become lines in order, a diamond becomes an if, an arrow back becomes a loop, and a wait for a person becomes a button. On a real traffic light module.
0 of 5 steps
Plan in plain words before you write Python: turn pseudocode into code line by line to find the hottest of a day's hull temperatures, then the average and the hot hours, check your work against Python's built-ins, and raise an alarm.
0 of 6 steps
Be the computer with a trace table, then debug one bug at a time.
Be the computer: fill in a trace table for a loop before running it, print the trace to check yourself, trace a while loop to its last turn, find a swap bug on paper, and follow values through nested function calls.
0 of 5 steps
Debug like a programmer, one bug at a time: predict what a recipe program should print, compare it with what it does, and fix a scaling formula upside down, a loop that skips the last step, two steps in the wrong order, and an egg count that rounds the wrong way.
0 of 5 steps
Every habit in one build: a sorting robot on the traffic lights.
The project: a robot that sorts cargo crates by weight. Draw the crates as bars, do one pass of neighbor swaps, repeat it into a full bubble sort, stop early when nothing moves, show every compare and swap on the traffic lights, and count the cost of the worst case.
0 of 6 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Thinking like a programmer are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Raspberry Pi 4 Model B with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Patterns and loops, Pseudocode first and Debug a recipe.
With "Break it down", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.