Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def int_to_chr(word):
- string = list(word)
- num_as_str = list()
- while string[0].isdigit():
- num_as_str.append(string[0])
- string.pop(0)
- num = int(''.join(num_as_str))
- string.insert(0, chr(num))
- return ''.join(string)
- def switch_letters(word):
- letters = list(word)
- letters[1], letters[-1] = letters[-1], letters[1]
- return ''.join(letters)
- def decipher(word):
- word = int_to_chr(word)
- word = switch_letters(word)
- return word
- print(' '.join([decipher(word) for word in input().split()]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement