subject

You are given a dictionary consisting of word pairs. Every word is a synonym of the other word in its pair. All the words in the dictionary are different. After the dictionary there's one more word given. Find a synonym for it.

Python
dict = {}
times = int(input())
for _ in range(times):
a = input()
w1, w2 = a. split()
dict[w1] = w2
dict[w2] = w1
print(dict[input()])

How can I further condense this code?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 12:30, Conner4600
Svieta is making a chart of the hours that different employees have put into a team project at work. what formula would autosum most likely generate if added into b8?
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, Abrahamolve
When creating a field in a table, you must set the to determine what type of data the field can store. field property data type field type data property
Answers: 1
image
Computers and Technology, 24.06.2019 19:50, joejoefofana
How to unblock on chrome book? ?
Answers: 1
image
Computers and Technology, 24.06.2019 20:00, broach605
Individuals suffering from technology overload feel distressed when deprived of computers and mobile devices. true/fasle
Answers: 2
You know the right answer?
You are given a dictionary consisting of word pairs. Every word is a synonym of the other word in it...

Questions in other subjects:

Konu
Mathematics, 29.03.2021 20:10
Konu
Geography, 29.03.2021 20:10