Easy
Swap Keys and Values
Read n lines of
key value (n first), build a dictionary, then print the inverted dictionary (values become keys).Input
n, then n lines.
Output
A dictionary.
Sample 1
Input
2 a 1 b 2
Output
{'1': 'a', '2': 'b'}Sample 2
Input
1 x y
Output
{'y': 'x'}Output appears here