Foundations — Reading documentation and debugging
Before you can read a traceback or a numpy signature, you must be able to read the vocabulary the parent note quietly assumes. This page builds every one of those pieces from nothing, in an order where each rung of the ladder rests on the one below it.
0. The very bottom rung: a "value"
You already met these in 1.4.1-Python-basics-syntax-and-variables. We name a box with =:
score = 85Read this right-to-left: "take the value 85, put it in a box, hang the label score on it." The = is not the maths equals — it is an arrow pointing left, an instruction to store.

1. Type — "what kind of thing is in the box?"
Why does the topic need this? Because the parent's debugging story ends with
print(student, type(student['score'])) # ... <class 'int'>That type(...) call is the single most useful debugging question: "Is the box holding the kind of thing I think it is?" A bug is very often a str "85" sitting where an int 85 was expected — they look identical when printed, but you cannot do maths on text.

2. Dict — a box with named compartments
You open a compartment with square brackets:
student['score'] # -> 85 ("look up the 'score' locker")The parent note leans on this constantly: student['score'], record['price']. The ['...'] is the lookup operation — "fetch the value filed under this key."
3. List and the loop — doing a thing to many things
To visit every carriage we use a for loop:
for student in students: # "for each carriage, call it 'student'"
total += student['score'] # do something with ittotal += x is shorthand for total = total + x — "add x into the running total." The += is an accumulator: it grows a value across the loop.
4. len( ), round( ), and the idea of a "function call"
len(students)→ how many items →2round(average, 2)→ roundaverageto2decimal places
The word argument just means "the thing you put in the parentheses." The word return means "the thing that drops out." The parent note's whole documentation section is really about reading the label on the vending machine: what buttons exist, what coins they need, what snack comes out.

5. Signature, parameters, defaults — reading the machine's label
Reading it left to right:
- Required parameter (
start,stop): no=, so you must supply it. - Default parameter (
num=50): has=value, so if you say nothing, it uses50.
6. The traceback — a story read bottom-to-top
The parent note says "read bottom-to-top." Here's why the picture makes that obvious:
- Top line = where your program started (
<module>, line 45). - Each lower line = one function that called the next.
- Bottom line = the exact statement that exploded, plus the exception type (
KeyError,TypeError).

7. Big-O notation — measuring "how much work"
The parent claims binary-search debugging turns work into . Let's earn those symbols.
Why and not something else? Because halving is repeated division by 2, and "how many times can I halve before I hit 1?" is exactly what answers. Every print that splits the suspect region in two is one halving.
Read: "the cost of searching lines = one check now, plus the cost of searching the surviving half." Unrolling that recursion is why the answer is a logarithm.
Prerequisite map
Both roads — the topic's "read docs" road and its "debug" road — start at the same humble box holding one value.
Equipment checklist
Cover the answer, say it out loud, then reveal.
What does = actually do, and how do you read it?
How do = and == differ?
= stores a value; == asks a True/False question comparing two values.What does type(x) tell you and why care while debugging?
How do you fetch the value filed under 'score' in a dict?
student['score'] — square brackets do a key lookup.What common error does a missing/misspelled dict key raise?
KeyError.In total += student['score'], what is += doing?
total = total + student['score'], growing a running total across the loop.What is the difference between a parameter and an argument?
How do you spot a default in a signature like num=50?
=value; if you say nothing, that value is used automatically.