-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab1of3.py
More file actions
36 lines (17 loc) · 1016 Bytes
/
Lab1of3.py
File metadata and controls
36 lines (17 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#Note that this code uses scientific notation to define large numbers. 4.445e8 is equal to 4.445 * 10 ** 8 which is equal to 444500000.0.
# The current volume of a water reservoir (in cubic metres)
reservoir_volume = 4.445 * 10 ** 8
# The amount of rainfall from a storm (in cubic metres)
rainfall = 5 * 10 ** 6
# decrease the rainfall variable by 10% to account for runoff
rainfall += rainfall * (10 / 100)
# add the rainfall variable to the reservoir_volume variable
reservoir_volume += rainfall
# increase reservoir_volume by 5% to account for stormwater that flows into the reservoir in the days following the storm
reservoir_volume += reservoir_volume * (5 % 100)
# decrease reservoir_volume by 5% to account for evaporation
reservoir_volume -= reservoir_volume * (5 % 100)
# subtract 2.5e5 cubic metres from reservoir_volume to account for water that's piped to arid regions.
reservoir_volume -= (2.5 * 10 ** 5)
# print the new value of the reservoir_volume variable
print(reservoir_volume)