Question 6: Operator Water Tank

🚰 Water Tank Fill

Use: import task_operators_06

A water tank holds 200 litres. Water is being poured in at 15 litres per minute. The tap was opened for 8 minutes, but 5 litres spilled out along the way. Write a Python program that calculates how much water is in the tank now, and how many more litres are needed to fill it completely.
  • Store the tank’s capacity in a variable called tank_capacity and set it to 200.
  • Store the flow rate in a variable called flow_rate and set it to 15.
  • Store the minutes the tap was open in a variable called minutes and set it to 8.
  • Calculate the total water poured in and store it in water_poured using flow_rate * minutes.
  • Store the amount spilled in a variable called spilled and set it to 5.
  • Calculate how much water is actually in the tank and store it in water_in_tank using water_poured - spilled.
  • Calculate how many more litres are needed to fill the tank and store it in needed_to_fill using tank_capacity - water_in_tank.
  • Print exactly two lines in this format:
    Water in tank: <water_in_tank> L
    Needed to fill: <needed_to_fill> L
    Use a separate print() call for each line.
Write what you are looking for, and press enter to begin your search!