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

1 Expert Approved Answer
Step: 1 Unlock

Python import pickle def loadvegetabledictionary Loads the vegetable dictionary from the file with openvegetablespickle rb as f vegetabledictionary pi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Starting Out With Python Questions!