1+"""Collected rainwater for one roof catchment."""
2+
3+ROOF_AREA_M2 = 46.0
4+TANK_LITRES = 220.0
5+
6+
7+def main() -> None:
8+ print("Rainfall to tank volume")
9+ print(f"Catchment {ROOF_AREA_M2:.0f} m2 into a {TANK_LITRES:.0f} L tank.")
10+
11+ while True:
12+ entered = input("How many mm of rain fell? ").strip()
13+ try:
14+ depth_mm = float(entered)
15+ if depth_mm <= 0:
16+ print("Enter a depth greater than 0.")
17+ continue
18+ break
19+ except ValueError:
20+ print("Enter a number, such as 8 or 12.5.")
21+
22+ litres = depth_mm * ROOF_AREA_M2
23+ fills = litres / TANK_LITRES
24+
25+ print("\nFrom that shower you collect:")
26+ print(f"- Water: {litres:.1f} L")
27+ print(f"- Tank fills: {fills:.2f}")
28+
29+if __name__ == "__main__":
30+ main()