Python from Scratch
From your first print() to classes and files. 9 modules: syntax, data types, conditions, loops, collections, functions, the standard library, OOP and working with files. Every lesson has theory with examples and a task that is checked automatically right in your browser. Before the harder lessons there are short warm-ups — you can skip them.
Log in to solve tasks and save your progress.
1. First steps
2. Data types
1
What is a data type?
10 XP
2
Warm-up: double the number warm-up
5 XP
3
Numbers
10 XP
4
Type conversion
10 XP
5
Warm-up: word length warm-up
5 XP
6
Strings
10 XP
7
String methods
10 XP
8
Warm-up: f-string warm-up
5 XP
9
String formatting
10 XP
10
Warm-up: greater than ten? warm-up
5 XP
11
The boolean type
10 XP
12
None — "nothing"
10 XP
3. Operators and conditions
4. Loops
5. Collections
6. Functions
7. Errors, modules and the standard library
1
Warm-up: is it a number? warm-up
5 XP
2
Handling errors: try / except
10 XP
3
Warm-up: square root warm-up
5 XP
4
Modules and import
10 XP
5
The math module
10 XP
6
Dates and times: datetime
10 XP
7
Warm-up: a dictionary as text warm-up
5 XP
8
JSON
10 XP
9
Regular expressions
10 XP
10
Installing libraries: pip
5 XP
11
Virtual environments: venv
5 XP
8. Object-oriented programming
1
Warm-up: your first class warm-up
5 XP
2
Classes and objects
10 XP
3
Warm-up: a pet has a name warm-up
5 XP
4
The __init__ constructor and self
10 XP
5
Warm-up: a counter warm-up
5 XP
6
Class attributes and instance attributes
10 XP
7
Methods: regular, class and static
10 XP
8
Magic methods
10 XP
9
Iterators and generators
10 XP
10
Warm-up: a child class warm-up
5 XP
11
Inheritance
10 XP
12
Polymorphism
10 XP
13
Encapsulation
10 XP
14
Nested classes
5 XP
9. Working with files
Tasks unlock in order: solve the current one to unlock the next. Warm-ups can be skipped.