Instructions
- Create a new python file: phone_book_system.py
- Inside the file, create an empty dictionary: phone_book. If you do not know how to create an empty dictionary, look at page 94 Starting with an empty Dictionary section.
- Continuously display the following menu and when user enter “exit”, stop the program.
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop):
- When user enter “1”, we should ask 2 questions to the user: name and phone number. After that add these 2 informations to the phone_book dictionary. The key would be name and value would be the phone number.
- When user enter “2”, ask user for name of the person he/she is trying to find the phone number. If the name exists in the dictionary key, then display the person’s phone number.
- When user enter “3”, the program will display all name and phone numbers inside the dictionary.
Expected Result
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 1
Enter a name: Gamas
Enter the phone: 888-888-8888
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 2
Enter a name you are trying to find: Gamas
Gamas phone number is 888-888-8888.
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 1
Enter a name: John
Enter the phone: 777-777-7777
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 2
Enter a name you are trying to find: john
John phone number is 777-777-7777.
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 3
gamas - 888-888-8888
john - 777-777-7777
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): 12312
What do you want to do
1. Add a phone number
2. Find a phone number
3. List all phone numbers
Enter your selection (enter 'exit' to stop): exit
Thank you for using our Phone application.