// 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
list_indexing_slicing.py
Indexing and slicing — reaching into a list for one element or many. Positive and negative indexes, slice ranges, step,…
// Code Example
list_methods_mutating.py
Mutating list methods — append, insert, extend, remove, pop, clear, sort, reverse. Methods that change the list directl…
// Code Example
list_methods_inspection.py
Inspection methods — in, len, index, count, copy, min, max, sum. Reading a list without changing it, and the copy trap …
// Code Example
list_iteration.py
Iterating over lists — for loops, enumerate, zip, and while. Every pattern for going through a list, and when to reach …
// Code Example
list_nested.py
Nested lists — lists inside lists. Creating, accessing with double indexes, looping with nested for, modifying inner li…
// Exercise
shopping_list.py
shopping_list.py — A shopping list that lives in a loop. Add items, remove them safely, quit when done. append(), remov…
// Exercise
grade_book.py
Grade Book — nested lists for three subjects, grade input, average per subject, overall average, and empty list protect…
// Exercise
even_numbers.py
Even Numbers — collect 6 inputs, filter with a function, return a clean list. Modulo, append, and a function that doesn…
// Other
list_mistakes.py
8 mistakes almost every beginner makes with lists. Wrong way, error, right way — all in one file.
// Cheatsheet
Lists — The Full Picture
Lists — The Full Picture. Creating, indexing, slicing, mutating methods, inspection, iteration, nested lists, split(), …
// Achievement
lists_complete_medal.stl
You finished the Lists chapter. Download, print, and keep it. You earned it.
// Code Example
dict_creation.py
Dict creation — literals, empty dicts, keyword arguments, zip from two lists, and adding keys one at a time. Every way …
// Code Example
dict_reading.py
Reading from a dict — square brackets, get(), default values, and keys/values/items views. Direct when certain, safe wh…
// Code Example
dict_modifying.py
Modifying a dict — direct assignment, update, setdefault, pop, popitem, clear. Methods that write, and the one mistake …
// Code Example
dict_inspection.py
Getting information from a dict — in, len, keys, values, items, copy. Reading without changing, and the copy trap that …