Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- words = {}
- for _ in range(n):
- word = input()
- synonym = input()
- if word in words:
- words[word].append(synonym)
- else:
- words[word] = [synonym]
- for _ in words:
- print(f"{_} - {', '.join(words[_])}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement