题解 | #排序#
翻转单词序列
http://www.nowcoder.com/practice/3194a4f4cf814f63919d0790578d51f3
-- coding:utf-8 --
class Solution:
def ReverseSentence(self, s):
# write code here
l = s.split(" ")
l.reverse()
str = ""
for i in range(len(l)):
if i != len(l) - 1:
str = str + l[i] + " "
else:
str += l[i]
return str