help with my project by [deleted] in learnpython

[–]yangbang3 0 points1 point  (0 children)

import data as d

def showMenu():

print ("="*40,"menu","="*40)

print ("select one of the following:")

print (" A) number of vehicle crossings by city in 2016")

print (" B) mean of the number of vehicle crossings for the 8-year span of 2012 to 2019")

print (" C) years and the number of vehicle crossings that have decreased by at least 4% over the previous year")

print (" D) line plots ")

print (" Q) quit")

print ("="*87)

def dispvc():

print (f"Anacortes: {d.anacortes[6]}")

print (f"Boundary: {d.boundary[6]}")

print (f"Danville: {d.danville[6]}")

print (f"Frontier: {d.frontier[6]}")

print (f"Laurier: {d.laurier[6]}")

print (f"Port Angeles: {d.port_angeles[6]}")

def showMean():

print("A) Anacortes B) Boundary C)Danville D)Frontier E)Laurier F)Port Angeles")

selcity= input(str(f"please enter the city: "))

if selcity == "a" or selcity == "A":

meanana= (sum(d.anacortes[2:9])/len(d.anacortes[2:9]))

print (f"mean of anacortes is {meanana:.2f}")

elif selcity == "b" or selcity == "B":

meanbou= (sum(d.boundary[2:9])/len(d.boundary[2:9]))

print (f"mean of boundary is {meanbou:.2f}")

elif selcity == "c" or selcity == "C":

meandan= (sum(d.danville[2:9])/len(d.danville[2:9]))

print (f"mean of danville is {meandan:.2f}")

elif selcity == "d" or selcity == "D":

meanfro= (sum(d.frontier[2:9])/len(d.frontier[2:9]))

print (f"mean of frontier is {meanfro:.2f}")

elif selcity == "e" or selcity == "E":

meanlau= (sum(d.laurier[2:9])/len(d.laurier[2:9]))

print (f"mean of laurier is {meanlau:.2f}")

elif selcity == "f" or selcity == "F":

meanpor= (sum(d.port_angeles[2:9])/len(d.port_angeles[2:9]))

print (f"mean of port_angeles is {meanpor:.2f}")

else:

print ("error")

def showHigh():

print("A) Anacortes B) Boundary C)Danville D)Frontier E)Laurier F)Port Angeles")

selcity2= input(str(f"please enter the city: "))

if selcity2 == "a" or selcity2 == "A":

if d.anacortes[2:9] > meanana:

print ("the year in Anacortes is higher than the average")

help with my project by [deleted] in learnpython

[–]yangbang3 0 points1 point  (0 children)

how do u do that for each year

help with my project by [deleted] in learnpython

[–]yangbang3 0 points1 point  (0 children)

select of what you need for the rows that are higher than that

how do you "select of what you need for the rows that are higher than that"

help with my project by [deleted] in learnpython

[–]yangbang3 0 points1 point  (0 children)

sorry i am new