Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- notQuit = True
- print("Select 1 to display telephone listing")
- print("Select 2 to add new telephone listing")
- print("Select 3 to quit")
- while notQuit == True:
- selection = input("Selection: ")
- selection = int(selection)
- telephoneBook = {
- "Ernest Hemingway":"414-878-7745",
- "Stephen King":"240-123-4564",
- "Charles Dickens":"321-458-7785"
- }
- if selection == 1:
- print("Client Name || Telephone#")
- for x in telephoneBook:
- print(x + ": " + telephoneBook[x])
- elif selection == 2:
- newListingKey = str(input("Enter name: "))
- newListingValue = str(input("Enter phone number"))
- telephoneBook[newListingKey] = newListingValue
- elif selection == 3:
- notQuit = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement