正则表达式轻松通过
import re
tj = re.compile("\W+")
in_put = input()
word_list = tj.split(in_put)
try:
word_list.remove("")
except Exception:
pass
out_put = ''
N = len(word_list)
for i in range(N):
out_put += (word_list[(N- 1 - i)] + " ")
print(out_put)