Last active
August 5, 2022 23:25
-
-
Save daniel-schroeder-dev/845553755663d355a98cc01013b0afb1 to your computer and use it in GitHub Desktop.
Class Gist - H112 - Lesson 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## BEGIN FUNCTION DEFINITIONS ###################### | |
def view_all_contacts(): | |
for name, num in contacts.items(): | |
print(f"{name}'s phone number: {num}") | |
def view_contact(): | |
pass | |
def add_contact(): | |
pass | |
def update_contact(): | |
pass | |
def remove_contact(): | |
pass | |
########################## END FUNCTION DEFINITIONS ###################### | |
options = """\ | |
(1) View All Contacts (2) View Contact (3) Add Contact | |
(4) Update Contact (5) Remove Contact (6) Exit | |
""" | |
contacts = { | |
"Steve" : "467-432-0102", | |
"Mark" : "587-437-3254", | |
} | |
while True: | |
choice = int(input(options)) | |
if choice == 1: | |
view_all_contacts() | |
elif choice == 2: | |
view_contact() | |
elif choice == 3: | |
add_contact() | |
elif choice == 4: | |
update_contact() | |
elif choice == 5: | |
remove_contact() | |
elif choice == 6: | |
break | |
else: | |
print(f"{choice} is not a valid option") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment