Need help with this PLEASE Create a dictionary with at-least 5 entries with name as key and phone number as its value. Both are string. The phone number should be in the format XXX-XXX-XXXX. Write a menu-driven program with the following menu options: a. Lookup up a phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, print the phone number. b. Update a Phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, ask the user to input the updated phone number and display your updated dictionary. c. Delete a phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, delete the entry and display the dictionary after deletion.
Need help with this PLEASE
-
Create a dictionary with at-least 5 entries with name as key and phone number as its value. Both are string. The phone number should be in the format XXX-XXX-XXXX.
-
Write a menu-driven program with the following menu options:
a. Lookup up a phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, print the phone number.
b. Update a Phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, ask the user to input the updated phone number and display your updated dictionary.
c. Delete a phone number based on name. Ask the user to input a name, if the name is not present in the dictionary, print an error message. Otherwise, delete the entry and display the dictionary after deletion.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images