cubic_mile_of_water.py

#!/usr/bin/python3
# ===================================================================
# Ask Marilyn - Newspaper, Sunday, May 22, 2022
# Say you have one cubic mile of water, and release it at the rate
# of 1,000 gallons a minute. About how long would it take to drain
# the entire tank?
#
# ---- from the web
# 1 cubic foot of water = 7.48052 US liquid gallons
# ===================================================================

# calc: gallons in a cubic mile
tank_gallons = 5280.0 * 5280.0 * 5280.0 * 7.48052

# calc: minutes in one year (365 days)
mins_in_year = 365.0 * 24.0 * 60.0

# calc: minutes to empty tank at 1,000 gallons/minute
mins_to_empty = tank_gallons / 1000.0

# calc: years to empty tank
years_to_empty = mins_to_empty / mins_in_year

# results

print()
print(f'It will take {round(years_to_empty,2)} years to empty the tank')
print()