题解 | #单词倒排#
单词倒排
http://www.nowcoder.com/practice/81544a4989df4109b33c2d65037c5836
in_str = str(input()) out_str = [] mid_str = "" for i in in_str : j = ord(i) if 65<=j<=90&nbs***bsp;97<=j<=122: mid_str += i else: if mid_str != "": out_str.append(mid_str) mid_str = "" out_str.append(mid_str) out_str.reverse()#str[::-1]#list.reverse() print(" ".join(out_str))