Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- coded_list = input().split()
- for code in coded_list:
- new_word = chr(int("".join([num for num in code if num.isdigit()])))
- the_rest = [letter for letter in code if letter.isalpha()]
- if len(the_rest) > 1:
- the_rest[0], the_rest[-1] = the_rest[-1], the_rest[0]
- new_word += "".join(the_rest)
- else:
- new_word += the_rest[0]
- print(new_word, end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement