viligen

decipher_this

Oct 16th, 2021
764
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. text = input().split()
  2. first_letter = ""
  3. new_text = []
  4.  
  5. for word in text:
  6.     word = list(word)
  7.     while word[0].isdigit():
  8.         first_letter += word[0]
  9.         word.pop(0)
  10.  
  11.     first_letter_chr = chr(int(first_letter))
  12.  
  13.     word = [first_letter_chr] + word
  14.     first_letter = ""
  15.     word[1], word[-1] = word[-1], word[1]
  16.     new_word = ''.join([str(s) for s in word])
  17.     new_text.append(new_word)
  18.  
  19. print(*new_text)
RAW Paste Data