Explain the names, calculations, and text report used by the first program. Name each reading, calculate the mean, format one labelled result, and inspect a value when its behavior is surprising.
The first chapter used names such as total, count, and mean because they made a small calculation readable. We could run and change that program without explaining every symbol. Now we will return to the same report and account for each part of it.
First, each temperature reading receives a name. We then calculate with those numerical values and place the result inside a short line of text. Keeping one report throughout the chapter lets us see why each new idea is needed instead of learning a list of disconnected Python features.
By the end, you will be able to read a familiar line from its inner values to its complete effect. You will also know how to inspect a value whose behavior is surprising and when a conversion from text to a number is justified. The next chapter removes the repeated reading names by letting a program choose and repeat work.
After this chapter
Trace assignment and reassignment by reading the right side before updating the name on the left.
Calculate the report's total and mean and verify evaluation order with a hand calculation.
Build a labelled report that keeps numerical values separate from text and display formatting.
Identify literals, names, operators, expressions, function calls, arguments, and complete statements in familiar lines.
Inspect an unexpected value and convert it only when its meaning supports the new type.