Data That Lasts

Last week you wrote a function that formatted a sale record beautifully. Then the program ended, and everything vanished. The formatted string, the tier classification, the loop counter -- all gone. It was like writing a report on a whiteboard, photographing it, then erasing the whole thing before starting the next one. Useful, but exhausting. This week your programs learn to remember. A variable is just a name attached to a value, but that small idea changes everything. Suddenly your code can keep a running total as it processes sales. It can count how many records belong to the West region while simultaneously tracking the East. It can remember that the last customer was a repeat buyer and adjust the logic accordingly. But memory introduces a new problem: type. The number 100 and the text "100" look identical on screen. Python sees them as completely different things, and if you mix them up, your totals will be wrong in ways that are genuinely hard to spot. You will learn why this matters, how to convert between types deliberately, and how booleans -- simple true-or-false values -- power every decision your program makes. By Friday you will build a program that collects sales entries into a list, validates each one, and prints a running summary. The whiteboard finally has a save button. The first thing you will save might surprise you.