题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
正则表达式轻松通过
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)