Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- secret_message = input().split()
- formated_message = []
- for word in secret_message:
- digits_word = ""
- rest_word = ""
- for letter in range(len(word)):
- if word[letter].isdigit():
- digits_word += word[letter]
- else:
- rest_word += word[letter]
- formated_message.append(chr(int(digits_word)) + rest_word)
- result = []
- for code in formated_message:
- code = list(code)
- code[1], code[-1] = code[-1], code[1]
- result.append(''.join(code))
- print(' '.join(result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement