Learn Python by writing real code

Learn variables, control flow, and loops with one of the most versatile programming languages.

Each chapter explains one idea, shows a worked example and then asks you to write and run your own Python code in the browser, with tests that check your answer.

The Python course is free: every chapter, example and exercise is open without a membership.

Python chapters

  1. Hello, World!
  2. Variables
  3. Control Flow
  4. Loops
  5. Lists
  6. Functions
  7. Strings
  8. Dictionaries
  9. Error Handling
  10. Classes
  11. Modules
  12. Files
  13. Comprehensions
  14. Tuples & Sets
  15. Generators
  16. Decorators
  17. Testing with pytest
  18. Async & HTTP