TaskGiven
n names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each
name queried, print the associated entry from your phone book on a new line in the form name=phoneNumber; if an entry for
name is not found, print Not found instead.
Note: Your phone book should be a Dictionary/Map/HashMap data structure.
Aqui ya inicialice algunas variables pero aun sigue el errordef phone_book():
n = int(input())
phone_book = {} # dictionary
for i in range(n):
string = input().split()
phone_book.update({string[0]: int(string[1])})
return phone_book
# processing
def query(phone_book):
i = 0
_query = ""
lenght = len(phone_book)
for i in range(lenght):
_query = input()
if _query in phone_book:
print("{0}={1}".format(_query, phone_book[_query]))
else:
print("Not found")
query(phone_book())