Advertisement
simeonshopov

Word synonyms

Feb 3rd, 2020
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. n = int(input())
  2. words = {}
  3.  
  4. for _ in range(n):
  5.     word = input()
  6.     synonym = input()
  7.     if word in words:
  8.         words[word].append(synonym)
  9.     else:
  10.         words[word] = [synonym]
  11.  
  12. for _ in words:
  13.     print(f"{_} - {', '.join(words[_])}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement