您的位置:首页 > 编程语言 > Python开发

python--leetcode344. Reverse String

2017-09-27 19:32 363 查看
Write a function that takes a string as input and returns the string reversed.

Example:

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

这一题就比较搞笑了....非常的easy.

class Solution(object):
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
a=s[::-1]
return a代码不需要解释吧,看了上一题后这一题就是小儿科。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: