剑指offer_字符串_翻转单词顺序列

字符串_翻转单词顺序列

在这里插入图片描述

# -*- coding:utf-8 -*-
class Solution:
    def ReverseSentence(self, s):
        # write code here
        res = list(s.split(" "))
        return " ".join(res[::-1])
发布了31 篇原创文章 · 获赞 0 · 访问量 745

猜你喜欢

转载自blog.csdn.net/freedomUSTB/article/details/104930836
今日推荐