Spocoman

08. Decipher This!

Feb 12th, 2022 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. message = input().split(' ')
  2.  
  3. for i in range(len(message)):
  4.     num = ''.join(filter(lambda x: x.isdigit(), message[i]))
  5.     message[i] = message[i].replace(num, chr(int(num)))
  6.     reverse_char = message[i][len(message[i]) - 1]
  7.     message[i] = message[i][:-1] + message[i][1]
  8.     message[i] = list(message[i])
  9.     message[i][1] = reverse_char
  10.     message[i] = ''.join(message[i])
  11.    
  12. print(' '.join(message))
  13.  
Add Comment
Please, Sign In to add comment