Skip to content
Permalink
Browse files
phonebook.py
  • Loading branch information
taylo403 committed Dec 14, 2018
1 parent 4d7a9d7 commit 8df4466ac96d05e6d67fe68667601d4fc6f85294
Showing 1 changed file with 53 additions and 0 deletions.
@@ -0,0 +1,53 @@
phonebook ={}


def print_menu():
print('1. Phone Numbers')
print('2. Add Phone Number')
print('3. Wipe Phone Number')
print('4. Find Phone Number')
print('5. Exit')
print()

def show_phonebook(search):
global phonebook
print(phonebook[search])

show_phonebook()
'''show_phonebook()'''
print("# Showing the phonebook")


if __name__== "__main__":
# Create some entries then show the phonebook
print("# Creating some entries...")
add_entry('myles123456789','myles@outlook.com','Coventry, CV1 4VB')

numbers ={}
menu_choice = 0
print_menu()
while menu_choice != 5:
menu_choice = int(input("Type in a number (1-5): "))
if menu_choice == 1:

print("Phone Numbers:")
elif menu_choice == 2:
print("Add Name and Number")
name = input("Name: ")
phone = input("Number: ")

print("Wipe Phone Number")
name = input("Name: ")
if name in numbers:
del numbers[name]
else:
print(name, "was not found")
elif menu_choice == 4:
print("Find Phone Number")
name = input("Name: ")
if name in numbers:
print("The number is", numbers[name])
else:
print(name, "not found")
elif menu_choice != 5:
print_menu()

0 comments on commit 8df4466

Please sign in to comment.