You are viewing a single comment's thread. Return to all comments →
n=int(input()) d={} for _ in range(n): details=input() f_name,phone_no=map(str,details.split()) d[f_name]=phone_no
while True: try: name=input() if name in d: print(f'{name}={d[name]}') else: print("Not found") except EOFError: break
Seems like cookies are disabled on this browser, please enable them to open this website
Day 8: Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
n=int(input()) d={} for _ in range(n): details=input() f_name,phone_no=map(str,details.split()) d[f_name]=phone_no
while True: try: name=input() if name in d: print(f'{name}={d[name]}') else: print("Not found") except EOFError: break