Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def print_menu():
- print('1. Print Phone Number')
- print('2. Add a Phone Number')
- print('3. Remove a Phone Number')
- print('4. Lookup a Phone Number')
- print('5. Quit')
- numbers = {}
- menu_choice = 0
- while menu_choice != 5:
- os.system("cls")
- print_menu()
- menu_choice = int(input("Type in a number (1-5): "))
- if menu_choice == 1:
- print("Telephone Numbers: ")
- for contact in numbers:
- print(f"Nama : {contact}\t Phone : {numbers[contact]}")
- print()
- input("ENTER to EXIT")
- elif menu_choice == 2:
- print("Add Name and Number for Contact")
- name = input("Name : ")
- phone = input("Phone : ")
- numbers[name] = phone
- input("ENTER to EXIT")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement