Float surprise
Two small top-ups of fuel, 0.1 and 0.2 tonnes, 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 a pilot needs to see.
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.
It's 0.1 plus 0.2. Write exactly what you expect Python to print.
Finish stage 1 to unlock this stage.
Investigate. Count how many digits Python prints after the decimal point for total and store the number in digits_after_point.
Modify. Keep the raw value, and under it add the line the fuel display shows, rounded to two decimal places:
0.30000000000000004 Fuel: 0.30 t
Finish stage 2 to unlock this stage.
Two engine burns last 1.1 and 2.2 seconds. Add them up, print the raw total, then the value the display shows with one decimal place:
Raw total: 3.3000000000000003 Burn time: 3.3 s
Hints
Basic Data Types
# Basic data types in Python
# int - whole numbers
number_of_planets = 8
print("Planets:", number_of_planets, type(number_of_planets))
# float - decimal numbers
deep_space_temp = -270.45
print("Temperature:", deep_space_temp, type(deep_space_temp))
# str - text (string)
galaxy = "Milky Way"
print("Galaxy:", galaxy, type(galaxy))
# bool - logical value
is_life_on_mars = False
print("Life on Mars:", is_life_on_mars, type(is_life_on_mars))
Separate arguments with commas. They're passed on every Run as sys.argv[1:].