sentence = input("Say: ")
sentence = sentence.split()
reverse_s = []
for word in sentence:
import re
r_word = list(re.sub("[^a-zA-Z]+", "",word))
word = list(word)
for letter in word:
if letter.isalpha():
reverse_s.append(r_word.pop())
else:
reverse_s.append(letter)
good_one = ''
print(good_one.join(reverse_s))
при выводе предложения не склеивались слова?
re.sub("[^a-zA-Z]+", "",word)
sentence = input("Say: ")
sentence = sentence.split()
new_sentence = ''
for word in sentence:
new_sentence += word[::-1] + ' '
print(new_sentence)