← All languages
Python
Scripting, data and web3.py — runs for real via Pyodide.
Theory — 50 written topics
Prefer to read first? The written Python topics and their multiple-choice questions now live under the Learn tab.
Open Python theory →Easy
Lessons 1-20 — fundamentals
- 1. Variables and f-stringsBind names to values and format text.
- 2. Functions and returnYour first reusable block.
- 3. String methodsSlice, upper/lower, and check membership.
- 4. if / elif / elseBranch on a numeric condition.
- 5. for loops and rangeRepeat work over a range.
- 6. ListsIndex, append, and slice.
- 7. DictionariesKey-value records.
- 8. List comprehensionsBuild lists concisely.
- 9. Tuples and unpackingFixed-size records and unpacking.
- 10. SetsUnique values and set operations.
- 11. while loopsLoop until a condition changes.
- 12. Default argumentsParameters with fallback values.
- 13. *argsVariadic positional arguments.
- 14. Lambda and sortedSort with a custom key.
- 15. ExceptionsHandle errors gracefully.
- 16. Classes and __init__Bundle state and behavior.
- 17. JSON encode/decodeSerialize and parse structured data.
- 18. split and joinTurn text into lists and back.
- 19. enumerate and zipPair indices and values.
- 20. Dict comprehensionsBuild dictionaries concisely.
Medium
Lessons 21-37 — patterns and real code
- 21. Generators and yieldProduce values lazily.
- 22. DecoratorsWrap a function to add behavior.
- 23. Context managersUse with and contextlib.
- 24. Inheritance and super()Extend a base class.
- 25. DataclassesStructured records with less boilerplate.
- 26. Type hintsAnnotate function signatures.
- 27. Regular expressionsValidate patterns with re.
- 28. Dates and timestampsConvert Unix epoch seconds to readable dates.
- 29. Counter and defaultdictSpecialized containers from collections.
- 30. Sorting with multiple keysSort by more than one field.
- 31. Validating parsed JSONCheck required fields before trusting data.
- 32. Hashing with hashlibCompute SHA-256 digests.
- 33. Bytes and hex encodingConvert between hex text and raw bytes.
- 34. Assertions and edge casesWrite robust validation logic.
- 35. Parsing CSV textRead tabular data safely.
- 36. Pure parsing functionsSeparate parsing logic from formatting.
- 37. itertools and reduceFunctional-style aggregation helpers.
Hard
Lessons 38-50 — advanced and capstone
- 38. Concurrency with threadingRun I/O-bound work on multiple threads.
- 39. async/await with asyncioRun coroutines concurrently.
- 40. Abstract base classesDefine enforced interfaces.
- 41. Operator overloadingMake a custom class support + and ==.
- 42. Shallow vs deep copyUnderstand shared references.
- 43. Efficient membership checksUse sets for O(1) lookups.
- 44. Dispatch tablesReplace long if/elif chains with a dict.
- 45. A mini token ledgerModel balances and validated transfers.
- 46. Filtering event logsAggregate structured event data.
- 47. Merkle rootCombine leaf hashes into a single root.
- 48. A tiny stack-based VMExecute simple opcodes against a stack.
- 49. Structural typing with ProtocolDuck typing checked statically.
- 50. Capstone: trade analytics summaryCombine parsing and aggregation into one report.