Advertisement
bl00dt3ars

08. Decipher This!

Jun 16th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. secret_message = input().split()
  2.  
  3. for el in secret_message:
  4.     current_word = []
  5.     asci_letter = ""
  6.     for word in el:
  7.         if word.isdigit():
  8.             asci_letter += word
  9.         else:
  10.             current_word.append(word)
  11.     current_word.insert(0, chr(int(asci_letter)))
  12.     current_word[1], current_word[-1] = current_word[-1], current_word[1]
  13.     print("".join(current_word), end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement