← Learn to program
Phase 3 · Programming
Python from zero
13 short lessons, each with examples you run in one click and exercises the site grades itself by running your code and comparing its output with the correct solution.
Your progress0%
0 of 26 exercises solved
Progress is saved in this browser only.
The editor runs Python 3 in your browser with Skulpt and supports the core language plus libraries such as math and random. Big data libraries such as pandas need Python installed on your computer.
Lessons
12 exercises22 exercises32 exercises42 exercises52 exercises62 exercises72 exercises82 exercises92 exercises102 exercises112 exercises122 exercises132 exercises
Your first Python program
print, comments, and how a program runs.
Variables and data types
int, float, str and bool, and converting between them.
Operators and f-strings
Arithmetic, comparison and formatted printing.
Reading input
Let the program ask the user.
Conditions: if, elif, else
Let the program decide.
Loops: for and while
Repeat without repeating code.
Lists
Keep many values in one variable.
Dictionaries
Keys and values, like a row in a table.
Functions
Write code once, use it many times.
Strings and data cleaning
strip, split, replace and more.
Errors and try / except
Keep your program from crashing.
Object-oriented programming
A class is a blueprint; an object is an instance.
Project: a sales report
Put everything together in a real analysis.