// resources
Resources
All
|
Cheatsheet
Code Example
Exercise
Template
Other
Achievement
|
Basics
Control Flow
Functions
Data Structures
Modules & Packages
Projects
Object-oriented programming
|
↑ oldest first
↓ newest first
// Code Example
dict_iteration.py
Iterating over a dict — keys, values, and pairs. The three patterns, when to use each, and how to build a new dict from…
// Code Example
dict_nested.py
Nested dicts — one structure, all the data. Creating, accessing with two keys, looping with items(), modifying inner di…
// Exercise
tip_calculator.py
Tip Calculator — bill amount, service rating, dict lookup, tip and total calculation. A dict doing exactly what dicts a…
// Exercise
shopping_list_2.py
Shopping List upgraded — items with quantity and price, nested dict per entry, checkout with total. The list you built …
// Exercise
pet_shop.py
Pet Shop — nested dicts, view all, search by name, buy and mark as sold. A nested dict doing real inventory work.
// Other
dict_mistakes.py
8 mistakes almost every beginner makes with dicts. Wrong way, error, right way — all in one file.
// Cheatsheet
Lists — The Full Picture
Dicts — The Full Picture. Creating, reading, modifying, inspecting, iterating, nested dicts, safe access patterns, and …
// Cheatsheet
Dicts — The Full Picture
Everything you've learned about dicts — in one place. Creating, reading, modifying, inspecting, iterating, nested dicts…
// Achievement
dictionaries_complete_medal.stl
You finished the Dictionaries chapter. Download, print, and keep it. You earned it.
// Code Example
tuple_usage.py
Tuples in practice — indexing, slicing, looping, unpacking, multiple return values, dict keys, and converting between t…
// Exercise
temperature_converter_2.py
Temperature Converter — conversion formulas stored as tuples, looked up by mode, unpacked and applied. A tuple doing ex…
// Code Example
set_usage.py
Sets in practice — add, remove, discard, membership checking, union, intersection, difference, and the patterns that ma…
// Exercise
attendance_tracker.py
Mark students present one by one. Enrolled set, present set, absent via set difference. add(), in, and one line that do…
// Code Example
list_set_comprehensions.py
List and set comprehensions — transform, filter, and deduplicate in one line. Square brackets for lists, curly braces f…
// Code Example
dict_comprehensions.py
Dict comprehensions — build from a list, transform an existing dict, filter key-value pairs, swap keys and values, and …