Answer:
The program in Python is as follows:
n = int(input(""))
numList = []
for i in range(n):
word_pair = input("")
numList.append(word_pair)
name = input("")
for i in range(n):
if name.lower() in numList[i].lower():
phone = numList[i].split(" ")
print(phone[1])
Explanation:
This gets the number of the list, n
n = int(input(""))
This initializes list
numList = []
This iterates through n
for i in range(n):
This gets each word pair
word_pair = input("")
This appends each word pair to the list
numList.append(word_pair)
This gets a name to search from the user
name = input("")
This iterates through n
for i in range(n):
If the name exists in the list
if name.lower() in numList[i].lower():
This gets the phone number associated to that name
phone = numList[i].split(" ")
This prints the phone number
print(phone[1])