…checklist", everyone knows exactly which steps that means. Functions work the same way. You describe the steps once, give them a name, and from then on the name is enough. Why bother? A few reasons…
…Python, let's make sure we understand what "base" actually means in the context of number systems. In our everyday decimal system (base 10), we have ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. When we…
Extend the alert check from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a…
…: they work, but nobody reading the code knows what they mean, and changing one means finding every copy. Predict what the report prints, find out where the magic numbers hide, then give them names…
…nearby, and range safety reports GO. One failed rule means HOLD. Write the GO/HOLD decision, then make it say which rules are holding the launch. GO or HOLD Clear the launch only if all three rules…
…really simplified explanation, but I'm sure you get what I mean). With Python, you write these instructions using English words and some symbols that are later interpreted so your PC can understand…
…curly braces, add a format spec after a colon: {speed:.2f} means "a number with 2 digits after the decimal point". Mass Add the mass, with commas between groups of three digits: Speed: 7.66 km/s Mass…
…the program says GO. Fix the decision, so that any problem means NO GO: Checked 4 sensors, last: CABIN ENG-2: 455.0 outside 0.0-450.0 Decision: NO GO The hidden tests also run the check with readings…