We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
n=int(input())
phn_bk={}
for i in range(n):
entry=list(input().split(" "))
phn_bk.update({entry[0]:entry[1]})
while (1):
try:
qry=input()
if qry in phn_bk:
print(f"{qry}={phn_bk.get(qry)}")
else:
print("Not found")
except (EOFError):
break
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
n=int(input()) phn_bk={} for i in range(n): entry=list(input().split(" ")) phn_bk.update({entry[0]:entry[1]}) while (1): try: qry=input() if qry in phn_bk: print(f"{qry}={phn_bk.get(qry)}") else: print("Not found") except (EOFError): break