Challenge
Magic numbers
…: 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…
Showing 11–20 of 24
Challenge
…: 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…
Challenge
…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…
Challenge
…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…
Challenge
…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…
Challenge
…True) , where nothing on the line says what that True means, and a careless copy and paste could abort a real mission. Make the confirmation impossible to give by accident. Keyword-only and required…
Challenge
…the new parameter last, so every call written before still means the same, and add print(send_command("ABORT", priority="high", timeout=1.0)) at the bottom.
Challenge
…elif branches, one per body, and every new destination means another branch. Turn the chain into a table without changing a single character of the output, then use the table for something the chain…
Challenge
…every change has to be made three times, and the next tank means a fourth copy. Turn the copies into one loop without changing a single character of the output, then see how cheap the next tank…
Challenge
…longitudes from 0 to 360 instead of from -180 to 180: 296 means 64 degrees west. The starter code picks New Norcia for 296, which is wrong. Before choosing, turn anything over 180 into the usual form…
Challenge
…rsplit("-", 1) splits from the right, and the 1 means "at most once". IDs like ENG-2 must still work.