Question: Write a program that keeps vegetable names and prices in a dictionary as key-value pairs. The program should display a menu that lets the user
Write a program that keeps vegetable names and prices in a dictionary as key-value pairs. The program should display a menu that lets the user see a list of all vegetables and their prices, add a new vegetable and price, change the price of an existing vegetable, and delete an existing vegetable and price. The program should pickle the dictionary and save it to a file when the user exits the program. Each time the program starts, it should retrieve the dictionary from the file and unpickle it.
Step by Step Solution
3.35 Rating (176 Votes )
There are 3 Steps involved in it
Python import pickle def loadvegetabledictionary Loads the vegetable dictionary from the file with openvegetablespickle rb as f vegetabledictionary pi... View full answer
Get step-by-step solutions from verified subject matter experts
