Python: Fundamentals and the Python 2 to 3 upgrade
A free study guide on Python with 19 lessons you can study step by step.
What you will learn
Part 1 · Python basics
- Running Python: indentation, comments and print
- Variables, dynamic typing and numbers
- Strings: f-strings, slicing and methods
- Operators, truthiness and the == versus is trap
- Decisions and loops: if, for, while, enumerate and zip
Part 2 · Data structures and functions
- Lists: ordered, changeable and shared
- Tuples and dictionaries
- Sets and comprehensions
- Functions: arguments, defaults and the mutable default trap
- Scope, closures and lambda
Part 3 · Objects and errors
- Classes, objects and self
- Special methods: __repr__, __eq__ and friends
- Inheritance, super() and duck typing
- Exceptions: try, except, else, finally and raise
- Dataclasses: classes without the boilerplate
Part 4 · Files, modules and packages
- Reading and writing files with with and pathlib
- Working with JSON and CSV
- Modules, imports and the __main__ guard
- Virtual environments and pip
All tutorials · Practice quizzes