Now on Omarchy: read the manual without leaving your desktop
All practice

Python Practice

Hands-on Python lessons - write real code, run it instantly, and get checked by real tests.

Basic 0/22 complete

Python Practice

Twenty-two short, hands-on Python lessons: start with your first print statement, build up through error handling, generators, classes, and recursion, debug a real traceback, then climb into the code that runs clean and is still wrong. Each lesson gives you a task and a Run button - your code is checked against real tests the moment you run it. Everything runs in your browser.

The last six are the ones that bite at work. A traceback tells you where to look; these do not get you that. A default argument that was built once and remembers the last shopper, a loop that skips items because the list shrank under it, a copy that was never really a copy, a total that is off by a cent because money went through a float, and a capstone where or 0 quietly turns "nobody recorded this" into "this was zero" and drags an average down with it.

Start with lesson 1. You can leave and come back any time - your code is saved locally.

Lessons

22 total
  1. 01 Print and variables
  2. 02 Conditionals
  3. 03 Loops
  4. 04 Lists
  5. 05 Dictionaries
  6. 06 Error handling
  7. 07 Generators
  8. 08 Fix the bug: read the traceback
  9. 09 Classes and inheritance
  10. 10 List comprehension rewrite
  11. 11 Recursion kata: factorial and Fibonacci
  12. 12 Stats calculator: mean and variance
  13. 13 String-alignment formatter
  14. 14 Time calculator
  15. 15 Probability calculator
  16. 16 Capstone: word counter
  17. 17 Fix the bug: the second cart is not empty
  18. 18 Fix the bug: the list shrinks while you walk it
  19. 19 Fix the bug: the copy that everyone shares
  20. 20 Fix the bug: every handler reports the last channel
  21. 21 Fix the bug: the till is a penny short
  22. 22 Capstone: the average that reads too low