Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sentence = input().split()
- new_sentence = []
- for word in sentence:
- current_word = ''
- word=list(word)
- num_str=[n for n in word if n.isdigit()]
- number=int(''.join(num_str))
- word=[i for i in word if i not in num_str]
- word[0], word[-1] = word[-1], word[0]
- word=''.join(word)
- current_word+=(chr(number))+word
- new_sentence.append(current_word)
- for words in new_sentence:
- print(words, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement