LeetCode-344:Reverse String



This  is a  "Pick One" Problem :【Problem:344-Reverse String

Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh".

 

Python实现字符串反转: s [::-1]

class Solution:
    def reverseString(self, s):
        """
        :type s: str
        :rtype: str
        """
        s=input("请输入需要反转的内容:")
        return s[::-1]
        

But:

 

posted on 2017-12-25 18:50  CuriousZero  阅读(171)  评论(0编辑  收藏  举报

导航