) Python command line menu-driven application that allows a user to display, sort and update, as needed a List of U.S states containing the state capital, overall state population, and state flower. The Internet provides multiple references with these lists. For example:

1 answer
Question:

) Python command line menu-driven application that allows a user to display, sort and update, as needed a List of U.S states containing the state capital, overall state population, and state flower. The Internet provides multiple references with these lists. For example:

Answers

Answer:Explanation:The following is a Python program that creates a menu as requestes. The menu allows the user to choose to display list, sort list, update list, and/or exit. A starting list of three states has been added. The menu is on a while loop that keeps asking the user for an option until exit is chosen. A sample output is shown in the attached picture below. states = {'NJ': ['Trenton', 8.882, 'Common blue violet'], 'Florida':['Tallahassee', 21.48, 'Orange blossom'], 'California': ['Sacramento', 39.51, 'California Poppy']} while True:    answer = input('Menu: \n1: display list\n2: Sort list\n3: update list\n4: Exit')    print(type(answer))    if answer == '1':        for x in states:            print(x, states[x])    elif answer == '2':        sortList = sorted(states)        sorted_states = {}        for state in sortList:            sorted_states[state] = states[state]        states.clear()        states = sorted_states        sorted_states = {}    elif answer == '3':        state = input('Enter State: ')        capital = input('Enter Capital: ')        population = input('Enter population: ')        flower = input('Enter State Flower: ')        states[state] = [capital, population, flower]    else:        break

Similar Solved Questions

2 answers

What percent of 126 is 22?

what percent of 126 is 22?...
1 answer

In choosing between two colleges that have offered you admittance, which is the least important criterion to consider? Look at the attached file for possible answers. :)

In choosing between two colleges that have offered you admittance, which is the least important criterion to consider? Look at the attached file for possible answers. :)...
2 answers

What is 19 +19 pls hurry its a quiz

what is 19 +19 pls hurry its a quiz...
1 answer

Bone formation exceeds bone resorption in osteoporosis.

Bone formation exceeds bone resorption in osteoporosis....
2 answers

What is the volume of a box measuring 2cm by 3cm by 4cm?

What is the volume of a box measuring 2cm by 3cm by 4cm?...
1 answer

What law/act was passed by Britain that forbid colonists to settle west of the AppalachianMountains?

What law/act was passed by Britain that forbid colonists to settle west of the AppalachianMountains?...
1 answer

Minerals transferred the same amont of energy into both minerals. Why did one mineral change and the other stayed the same?

Minerals transferred the same amont of energy into both minerals. Why did one mineral change and the other stayed the same?...
1 answer

Geometry, please answer question ASAP

Geometry, please answer question ASAP...
1 answer

What are the coordinates of the midpoint of the segment whose endpoints are A(-1,-2) and B(6,12)?

what are the coordinates of the midpoint of the segment whose endpoints are A(-1,-2) and B(6,12)?...
1 answer

Taylor completed 2/3 of her homework. Riian completed 7/8 of her homework. Taylor and Riian have the same amount of homework. Who completed a greater amount of homework?

Taylor completed 2/3 of her homework. Riian completed 7/8 of her homework. Taylor and Riian have the same amount of homework. Who completed a greater amount of homework?...
1 answer

What is (2x+5)(x+6) as a sum

What is (2x+5)(x+6) as a sum...
2 answers

Answe please BEN..........

Answe please BEN.............
1 answer

The profit p in dollars of selling x widgets and y gadgets is given by the function p(x,y)=7x+6y. Which corner point of the shaded region will maximize the profit?

The profit p in dollars of selling x widgets and y gadgets is given by the function p(x,y)=7x+6y. Which corner point of the shaded region will maximize the profit?...
2 answers

Which coping style is associated with "doing" and "getting" things done?

Which coping style is associated with "doing" and "getting" things done?...
1 answer

Cricket to use a cliché is in my blood what did gavaskar mean to say in this statement

Cricket to use a cliché is in my blood what did gavaskar mean to say in this statement...
2 answers

What is nucleotide plss ​

what is nucleotide plss ​...
2 answers

May I please receive help on this question

May I please receive help on this question...
2 answers

All the members of a species that live in an area make up?​

all the members of a species that live in an area make up?​...
1 answer

A speech of seeks to touch on deep feelings and uplift listeners.

A speech of seeks to touch on deep feelings and uplift listeners....
1 answer

Find 5 consecutive whole numbers if it is known that the sum of the squares of the first 3 numbers is equal to the sum of the squares of the last 2 numbers.

Find 5 consecutive whole numbers if it is known that the sum of the squares of the first 3 numbers is equal to the sum of the squares of the last 2 numbers....

-- 0.021325--