aminamuhammad11
14.03.2022 •
Computers and Technology
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?
Solved
Show answers
More tips
- F Food and Cooking How to Make Cottage Cheese Casserole? A Proven Recipe...
- L Leisure and Entertainment How to Solve a Rubik s Cube Easily and Quickly...
- H Health and Medicine Want to Lose Weight? Gain Muscle without Damaging Your Health!...
- F Family and Home Parquet or laminate, which is better?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
- L Leisure and Entertainment How to Make a Paper Boat in Simple Steps...
- T Travel and tourism Maldives Adventures: What is the Best Season to Visit the Luxurious Beaches?...
- H Health and Medicine Kinesiology: What is it and How Does it Work?...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
Answers on questions: Computers and Technology
- E English Which sentence is punctuated correctly? a.ned asked, how do these work ? b.zachary said, they look like tiny castles now . c. they really do! exclaimed preston, shaking...
- M Mathematics 10am/3 divided by -5a/6...
- H History How did the colonial independence movement create internal debate about the nature of the new nation, as mentioned in the excerpt...
Ответ:
The answer is A. 1 to 3
Hope I helped!!