Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. notQuit = True
  2. print("Select 1 to display telephone listing")
  3. print("Select 2 to add new telephone listing")
  4. print("Select 3 to quit")
  5. while notQuit == True:
  6. selection = input("Selection: ")
  7. selection = int(selection)
  8. telephoneBook = {
  9. "Ernest Hemingway":"414-878-7745",
  10. "Stephen King":"240-123-4564",
  11. "Charles Dickens":"321-458-7785"
  12. }
  13. if selection == 1:
  14. print("Client Name || Telephone#")
  15. for x in telephoneBook:
  16. print(x + ": " + telephoneBook[x])
  17.  
  18. elif selection == 2:
  19. newListingKey = str(input("Enter name: "))
  20. newListingValue = str(input("Enter phone number"))
  21. telephoneBook[newListingKey] = newListingValue
  22.  
  23.  
  24. elif selection == 3:
  25. notQuit = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement