Python, by example

Python by example - annotated code snippets covering the language from first principles to production.

20 lessons · Updated 2026-05-08

  1. 01Hello World
  2. 02Values
  3. 03Variables
  4. 04Numbers
  5. 05Strings
  6. 06Booleans and Truthiness
  7. 07Conditionals
  8. 08Loops
  9. 09Lists
  10. 10Tuples
  11. 11Dicts
  12. 12Sets
  13. 13Comprehensions
  14. 14Functions
  15. 15Closures and Decorators
  16. 16Generators and Iterators
  17. 17Classes and Dataclasses
  18. 18Exceptions
  19. 19Context Managers
  20. 20Async and await

Enjoyed this? Get more essays on software craft delivered to your inbox.

Subscribe free