Decisions
if, elif and else: comparisons, True and False, and, or and not, why indentation is part of the code, and a motion alarm that decides twice a second whether to light up.
Open it in the simulatorBeginner Python on a Raspberry Pi: print, variables, decisions, loops, lists, functions, dicts and strings, then a button with gpiozero and a working pedestrian crossing.
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.
if, elif and else: comparisons, True and False, and, or and not, why indentation is part of the code, and a motion alarm that decides twice a second whether to light up.
Open it in the simulatorDictionaries that look a value up by its name, strings you can split, clean and change, and a little command line on the Pi: type "red on" and the red light obeys.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Make the Pi talk, remember and decide.
Your first Python on a Raspberry Pi: print() to talk, variables to remember, a little math, f-strings, the three types you meet first, and an LED switched on from code.
0 of 6 steps
if, elif and else: comparisons, True and False, and, or and not, why indentation is part of the code, and a motion alarm that decides twice a second whether to light up.
0 of 6 steps
Loops, lists, functions and dicts: the tools every program is made of.
for and range, lists you can index and grow, a list of real LEDs lit one after another, while loops that run forever, and break to stop one when the job is done.
0 of 6 steps
def to name a few lines and run them by name, parameters and defaults, return to hand a value back, functions that choose a light, and why a value goes in and comes out instead of being shared.
0 of 6 steps
Dictionaries that look a value up by its name, strings you can split, clean and change, and a little command line on the Pi: type "red on" and the red light obeys.
0 of 6 steps
Read a button properly, with gpiozero.
A pushbutton on GPIO21: asking with is_pressed, why a pull-up keeps the pin from floating, waiting for a press, contact bounce, header pin numbers, timeouts, and callbacks that run when it happens.
0 of 6 steps
A pedestrian crossing built from everything in the course.
The boss project: a pedestrian crossing on the traffic light module and a button, built from everything in the course: a phase function, the sequence as a list, a loop waiting on the button, a counter and a flashing amber.
0 of 6 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Python from zero is part of the coding track, a ladder of courses from zero to expert.
The language, one idea per lesson, on a board that shows you what your code did.
Open the next coursePython and C++ from your first print to classes, tests and state machines. Every program runs on a simulated board, so a bug is something you can see.
See every course on the trackEvery 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 Python from zero 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: Decisions and Dicts and strings.
With "Print and variables", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.