Advertisement
MegaVerkruzo

Untitled

Feb 12th, 2020
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import sys
  2. for line in sys.stdin.readlines():
  3. a = list(line.split())
  4. for x in a:
  5. if ord(x[-1]) >= ord('a') and ord(x[-1]) <= ord('z') or ord(x[-1]) >= ord('A') and ord(x[-1]) <= 'Z' or x[-1] == '\'' or x[-1] == '\"':
  6. print(x[::-1], end = ' ')
  7. else:
  8. print(x[:len(x) - 1][::-1] + x[-1], end = ' ')
  9. print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement