Round or cut?
The cargo manifest needs whole kilograms, and there are two ways to get rid of the decimals: int() and round(). Most of the time they agree. When they don't, a crate can end up a kilogram lighter on paper than on the scales.
Predict where they differ, investigate a rule that surprises most programmers, then round a fuel reading 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.
The two functions handle the decimals differently. What does each one give for 1499.7?
Finish stage 1 to unlock this stage.
Investigate. Store what int(2.9) gives in int_of_2_9, and what round(2.5) gives in round_of_2_5. Run round(2.5) before you answer: most people get it wrong.
Modify. Print int() and round() side by side for all three masses, following the first line:
1499.7 kg: int 1499, round 1500 820.2 kg: int 820, round 820 312.5 kg: int 312, round 312
Finish stage 2 to unlock this stage.
The fuel display shows the reading to one decimal place, and the briefing rounds it to the nearest hundred. round() takes a second number for that: round(fuel_kg, 1) keeps one decimal place and round(fuel_kg, -2) rounds to hundreds. Print:
Fuel display: 1234.6 kg (about 1200 kg)
round(fuel_kg, -2) gives 1200.0, a float. Wrap it in int() to drop the .0.
Hints
Type Conversion
# Telemetry always arrives as text, even when it looks like a number
impact_speed_text = "22530"
orbit_change_text = "32.0"
# int() turns a string of digits into a whole number
impact_speed = int(impact_speed_text)
print("DART hit Dimorphos at", impact_speed, "km/h")
print("That is", round(impact_speed / 3600, 2), "km every second")
# float() does the same job for a decimal
orbit_change = float(orbit_change_text)
print("Orbit shortened by", orbit_change, "minutes")
# str() goes the other way. Plus only joins text to text
year = 2022
print("Impact year: " + str(year))
# print("Impact year: " + year) # delete the hash sign to meet a type error
# int() on a decimal chops off the fraction, it does not round
hours_per_orbit = 11.92
print("int gives", int(hours_per_orbit), "but round gives", round(hours_per_orbit))
# A decimal hiding inside a string needs float() first
raw = "11.92"
print("Converted safely:", int(float(raw)))
# print(int(raw)) # this one raises a value error
# type() confirms what you are actually holding
print(type(impact_speed_text), type(impact_speed), type(orbit_change))
Separate arguments with commas. They're passed on every Run as sys.argv[1:].