Keep Values in the Right Places
A café order has two quantities: item count and price per item. Python stores a number such as 3 separately from text such as "3". A list keeps several values in order; an index names a position, starting at zero.
Authored explanation · fixed examples, not a live experiment.
[2, 3]: quantity, unit price
→Index 0 → 2; index 1 → 3
→2 × 3 → 6 credits
How do list positions become a price? Name the evidence for your answer.
By the end of this lesson
Create and inspect numbers, text and lists without confusing positions with values.
Inside the lesson
- Read numbers and lists
- Predict a list lookup
- Run a changed order
- Explain types and positions
- Price a new order
- Keep the value trail
The reproducibility tasks require running the supplied Python starter. Setup instructions and examples are included.