forked from SamuelAbiodun-dev/C13-Python-Exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgallons.py
More file actions
15 lines (13 loc) · 660 Bytes
/
gallons.py
File metadata and controls
15 lines (13 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# If one inch of rain falls on an acre of land, how many gallons
# of water does that make?
if __name__ == '__main__':
inches = int(input('Enter the number of inches: '))
print("One acre of land is 66 by 660 feet which is 6_272_640 square inches.")
cubic_inches = inches * 6_272_640
print(inches, "inches on one acre of land is", cubic_inches, "cubic inches")
print("One gallon of water is 231 cubic inches.")
gallons = cubic_inches / 231
if inches == 1:
print("One(1) inch of rain on one acre of land is", gallons, "gallons.")
else:
print(inches, "inches of rain on one acre of land is", gallons, "gallons.")