generated from CambridgeEngineering/PartIA-Flood-Warning-System
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Task1D.py
30 lines (22 loc) · 1.02 KB
/
Task1D.py
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
from floodsystem.geo import rivers_with_station
from floodsystem.geo import stations_by_river
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 1D"""
# Create a list of stations
stations = build_station_list()
# Create list of rivers
rivers = rivers_with_station(stations)
# Display data from 10 rivers:
river_display = rivers[:10]
number_of_rivers = len(rivers)
print('There are {} rivers with at least one station. The first ten rivers are {}' .format(number_of_rivers, river_display))
# Create River dictionary
river_stations = stations_by_river(stations)
# Display desired rivers
print('The stations on the River Aire are {}'.format(river_stations['River Aire']))
print('The stations on the River Cam are {}'.format(river_stations['River Cam']))
print('The stations on the River Thames are {}'.format(river_stations['River Thames']))
if __name__ == "__main__":
print("*** Task 1D: CUED Part IA Flood Warning System ***")
run()