Unit mix-up
The flight dynamics team is checking the plan for a transfer to the Moon. One leg comes from a contractor's planning tool, and the total doesn't look right.
Predict what the code prints, find the leg that doesn't fit, fix the sum, then convert a lander's sensor readings yourself.
Finish stage 1 to unlock this stage.
Don't run the code yet. Read it and decide what it will print. Write your guess in prediction, at the top, between the quotes. Then run it and compare.
Any guess passes this stage: the point is to think before you run. After you check, you'll see your prediction next to what Python printed.
Add up the three legs the way Python will. :,.0f prints the total with no decimals and commas between the thousands.
Finish stage 1 to unlock this stage.
Investigate. Find the variable that holds a distance in a different unit and store its name, as text, in odd_one_out. Then convert it: one mile is 1.609344 km. Store leg 2 in km, as a number, in leg_2_in_km.
Modify. Add a constant KM_PER_MILE = 1.609344 at the top and convert leg 2 before it's added. It must print:
Trajectory length: 386,294 km
Finish stage 2 to unlock this stage.
A lander's altitude comes from its radar in metres, but the backup sensor reports the descent rate in feet per second, as many aircraft instruments do. Convert the rate to metres per second with a constant M_PER_FOOT = 0.3048, then print it and the time to touchdown:
Descent rate: 1.98 m/s Touchdown in: 60.6 s
The time to touchdown is the altitude divided by the descent rate, both in metres.
Hints
Basic Math Operations
# Mission fuel calculation
fuel_total = 1000
fuel_used = 350
fuel_remaining = fuel_total - fuel_used
print("Remaining fuel:", fuel_remaining, "liters")
# Engine power output
engines = 4
power_per_engine = 250
total_power = engines * power_per_engine
print("Total power:", total_power, "kW")
# Average speed calculation
distance = 1000
time_hours = 4
speed = distance / time_hours
print("Speed:", speed, "km/h")
Separate arguments with commas. They're passed on every Run as sys.argv[1:].