Advertisement
Bad_Programist

Untitled

Nov 28th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. a = input()
  2. b = a.split(' ')
  3. c = []
  4. for i in range(1, len(b), 2):
  5.     c.append(b[i])
  6.     c.append(b[i - 1])
  7. if len(b) % 2 == 1:
  8.     c.append(b[-1])
  9. res = ' '.join(c)
  10. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement