You are on page 1of 2

TRANSPORTATION SYSTEM ANALYSIS

RAINFALL_MONTHS=["January","February","March","April","May","June", "July",
"August","September" ,"October","November","December"]
monthly_rainfall=[]
for MONTH in RAINFALL_MONTHS:
Precipitation=float(input("Please Enter the rainfall in the month of {}:
".format(MONTH)))
monthly_rainfall.append(Precipitation)
TOTAL_RAINFALL= sum(monthly_rainfall)
AVERAGE_RAINFALL= TOTAL_RAINFALL/len(monthly_rainfall)
MAX_RAINFALL=max(monthly_rainfall)
MIN_RAINFALL=min(monthly_rainfall)
print("The Total rainfall for the year is :",TOTAL_RAINFALL)
print("The Average monthly rainfall is :" , AVERAGE_RAINFALL)
print("The highest amount of rainfall of the month is :",MAX_RAINFALL,)
print("The lowest amount of rainfall of the month is :", MIN_RAINFALL)

#TRANSPORTATION SAFETY ANALYSIS

place=input("Enter Location:")

year = {}

jan=float(input('Please enter number of road accidents in Jan : '))

feb=float(input('Please enter number of road accidents in Feb : '))

mar=float(input('Please enter number of road accidents inMar : '))

apr=float(input('Please enternumber of road accidents in Apr : '))

may=float(input('Please enternumber of road accidents in May : '))

jun=float(input('Please enternumber of road accidents in Jun : '))

jul=float(input('Please enter number of road accidents in Jul : '))

aug=float(input('Please enternumber of road accidents in Aug : '))

sep=float(input('Please enternumber of road accidents in Sep : '))

OCT=float(input('Please enter number of road accidents in Oct : '))

nov=float(input('Please enter number of road accidents in Nov : '))

dec=float(input('Please enternumber of road accidents in Dec : '))

year.extend((jan, feb, mar, apr, may, jun, jul, aug, sep, OCT, nov, dec))
def lowest():

print('The minimum number of road accident is', min(year.values()))

lowest()

def highest():

print('The most number of reported road accident happened in', max(year))

highest()

def total():

print('The total number of road accidents is', sum(year))

total()

def average():

print('The average road accident is', float(sum(year))/len(year))

average()

You might also like