Advertisement
Nenogzar

Untitled

Feb 14th, 2024
965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. message = input().split()
  2.  
  3. words = []
  4. for word in message:
  5.     num, let = "", ""
  6.     for symbol in word:
  7.         if symbol.isdigit():
  8.             num += symbol
  9.         else:
  10.             let += symbol
  11.     if len(let) != 1:
  12.         let = f"{let[-1]}{let[1:-1]}{let[0]}"
  13.     words.append(f"{chr(int(num))}{let}")
  14.  
  15. print(*words, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement