Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- message = input().split(' ')
- for i in range(len(message)):
- num = ''.join(filter(lambda x: x.isdigit(), message[i]))
- message[i] = message[i].replace(num, chr(int(num)))
- reverse_char = message[i][len(message[i]) - 1]
- message[i] = message[i][:-1] + message[i][1]
- message[i] = list(message[i])
- message[i][1] = reverse_char
- message[i] = ''.join(message[i])
- print(' '.join(message))
Add Comment
Please, Sign In to add comment