LearnPy Hub
← Tuples & Sets problems
Medium

Flip the Pairs

Read n lines of two words each. Store them as tuples, then print every tuple with its two items swapped, as tuples, one per line.

Input

n, then n lines.

Output

n lines.

Sample 1

Input
2
a b
c d
Output
('b', 'a')
('d', 'c')

Sample 2

Input
1
key value
Output
('value', 'key')
solution.py
Output appears here
Flip the Pairs · Python practice problem · LearnPy Hub