learn-to-code
4 free lessons tagged learn-to-code across Programming. Each one is a short sequence of focused steps with narration and a five-question quiz at the end — take them in any order, no signup required.
Debugging and Problem Solving: What to Do When Code Breaks
Every program breaks, so learn to fix one fast: the three kinds of error, reading a traceback from the bottom up, the beginner errors and their exact messages, print and debugger techniques for logic bugs, tests with assert, and a problem-solving routine plus a way to keep practising.
Functions, Lists, and Dictionaries: Organising a Program
Split a program into named functions with parameters and return values, and hold data in lists and dictionaries. Learn why return is not print, what local scope protects, the accumulator pattern, how to choose list or dictionary, and the aliasing trap, then build a monthly budget checker.
Decisions and Loops: Making a Program Choose and Repeat
Teach a program to react and repeat: booleans and comparisons, if/elif/else chains where order is logic, while and for loops, range() and its excluded stop, break and continue, and the skill that matters most, tracing a loop by hand. Ends with a working number-guessing game.
What a Program Is: Values, Variables, and Your First Script
Start from zero: what a program actually is, how to run Python in the shell or as a script, the four basic types, arithmetic expressions, variables as names, strings and f-strings, and why input() always hands you text. You finish by writing a working bill-splitting program.

