Question 7: Operator Rocket Fuel

🚀 Rocket Fuel Check

Use: import task_operators_07

A small model rocket has a fuel tank that holds 50 units of fuel. Each second of flight uses 4 units. The rocket is planned to fly for 9 seconds. Write a Python program that calculates how much fuel is left after the flight, and how many seconds the rocket could fly on the fuel that’s left.
  • Store the tank size in a variable called tank_fuel and set it to 50.
  • Store the fuel used per second in a variable called fuel_per_second and set it to 4.
  • Store the flight duration in a variable called seconds and set it to 9.
  • Calculate the total fuel used during the flight and store it in fuel_used using fuel_per_second * seconds.
  • Calculate the fuel left after the flight and store it in fuel_left using tank_fuel - fuel_used.
  • Calculate how many more seconds the rocket could fly on the remaining fuel and store it in extra_seconds using fuel_left // fuel_per_second.
  • Print exactly three lines in this format:
    Fuel used: <fuel_used>
    Fuel left: <fuel_left>
    Extra seconds: <extra_seconds>
    Use a separate print() call for each line.
Write what you are looking for, and press enter to begin your search!