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:

原文地址:https://www.cnblogs.com/shenxiaolin/p/8110730.html