题解 | #单词倒排#
单词倒排
https://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
import re
#输入字符串
str1=input()
#将标点符号替换为空格
str2 = re.sub(r'([^\s\w]|_|[0-9])+',' ',str1)
#将字符串按照空格划分
str3=str2.split()
#反向输出字符串
for x in str3[::-1]:
print(x,end=' ')

