Challenge
Extract a function
Move a 3D distance calculation that is copied for three waypoints into distance_km(a, b), keeping the output exactly the same, then put the waypoints in a dict and find the nearest one with the same…
7 results
Challenge
Move a 3D distance calculation that is copied for three waypoints into distance_km(a, b), keeping the output exactly the same, then put the waypoints in a dict and find the nearest one with the same…
Challenge
A cargo calculation uses a, b, x2 and tmp. Predict it, work out what each name holds, rename them so the code explains itself, then write a fuel check with good names.
Challenge
…way there is: seconds since launch. That's perfect for calculations and useless at a glance. Is 100000 seconds one day or three? Turn it into the clock the flight controllers read, one step at a time…
Challenge
…should count up: T+00:05:00 five minutes in. Move the calculation into countdown(launch, now) , which returns the text with T- before launch, and at launch itself, and T+ after it, then print…
Challenge
…can't be negative: {burn_s} s") inside an if , before the calculation. A burn of 0 seconds is allowed. Raise TypeError A burn length read from a file arrives as the text "40" , and the function stops…
Challenge
…any line you added before you check. Modify. Fix the calculation so it averages all three readings: add them up first, then divide. It must print: Average hull temperature: 20.9 °C Make: Average speed…
Challenge
…go into the tank. Adding them up should be the easiest calculation on board, and yet Python prints something nobody expects. Predict it, look closely at what came out, then make the display show what…