501,105 views
41 votes
41 votes
Codehs 9.4.5 Phone Book. Anyone have the answers?

User NikhilReddy
by
3.5k points

1 Answer

14 votes
14 votes

Answer:

my_dictionary = {}

while True:

name = str(input("Enter a name: "))

if name == "":

break

elif name in my_dictionary:

print("Phone Number: " + my_dictionary[name])

else:

phone_number = input("Enter this person's number: ")

my_dictionary[name] = phone_number

print(my_dictionary)

Explanation: code hs

User TambourineMan
by
2.9k points