Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- for line in sys.stdin.readlines():
- a = list(line.split())
- for x in a:
- 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] == '\"':
- print(x[::-1], end = ' ')
- else:
- print(x[:len(x) - 1][::-1] + x[-1], end = ' ')
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement