Question: Python code- Output should look like below for two option examples : Select one of the options listed below: P == Print Data A ==
Python code-
Output should look like below for two option examples :
Select one of the options listed below: P == Print Data A == Get Averages AZ == Average Per Zone AL == Above Levels by Zone BL == Below Levels Q == Quit
When entering P: Lead and Copper Water Study Zone Lead Copper
****************************************
North 1 10 0.03
North 2 13 0.25
North 3 5 1.4
North 4 16 0.15
East 1 17 0.37
East 2 8 0.85
East 3 3 1.5
East 4 2 0.99
West 1 6 0.55
West 2 9 1.1
West 3 11 0.97
West 4 8 0.77
South 1 4 0.82
South 2 7 0.74
South 3 6 0.96
South 4 5 1.1
When entering BL: Zones Below Safe Levels
*********************** Lead Zones Below Acceptable Levels
***********************************
North 1 10 North 2 13 North 3 5 East 2 8 East 3 3 East 4 2 West 1 6 West 2 9 West 3 11 West 4 8 South 1 4 South 2 7 South 3 6 South 4 5 Lead Zones Below Acceptable Levels
***********************************
North 1 0.03 North 2 0.25 North 4 0.15 East 1 0.37 East 2 0.85 East 4 0.99 West 1 0.55 West 2 1.1 West 3 0.97 West 4 0.77 South 1 0.82 South 2 0.74 South 3 0.96 South 4 1.1
Below is the template:
def GetChoice(): #local variables user_choice = str()
#Display menu and get choice print() print("Select one of the options listed below: ") print("\tP\t==\tPrint Data") print("\tA\t==\tGet Averages") print("\tAZ\t==\tAverage Per Zone") print("\tAL\t==\tAbove Levels by Zone") print("\tBL\t==\tBelow Levels") print("\tQ\t==\tQuit") print() user_choice = input("Enter choice: ") print() user_choice = user_choice.upper()
return user_choice
#enter the rest of your functions here.
def main(): #main variables. Do not change these zones = ["North 1", "North 2", "North 3", "North 4", "East 1 ", "East 2 ", "East 3 ", "East 4 ", "West 1 ", "West 2 ", "West 3 ", "West 4 ", "South 1", "South 2", "South 3", "South 4"] lead = [10, 13, 5, 16, 17, 8, 3, 2, 6, 9, 11, 8, 4, 7, 6, 5] copper = [0.03, 0.25, 1.4, 0.15, 0.37, 0.85, 1.5, 0.99, 0.55, 1.1, 0.97, 0.77, 0.82, 0.74, 0.96, 1.1] choice = str() #enter the rest of your code here
while True: choice = GetChoice() if choice == 'P': if choice == 'A': if choice == 'AZ': if choice == 'AL': if choice == 'BL': if choice == 'Q': break main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
