SHARE
TWEET

7

a guest Feb 16th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. coded_list = input().split()
  2.  
  3. for code in coded_list:
  4.     new_word = chr(int("".join([num for num in code if num.isdigit()])))
  5.     the_rest = [letter for letter in code if letter.isalpha()]
  6.     if len(the_rest) > 1:
  7.         the_rest[0], the_rest[-1] = the_rest[-1], the_rest[0]
  8.         new_word += "".join(the_rest)
  9.     else:
  10.         new_word += the_rest[0]
  11.     print(new_word, end=" ")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top