题解 | #判断回文#
判断回文
http://www.nowcoder.com/practice/e297fdd8e9f543059b0b5f05f3a7f3b2
使用python非常简单,只要字符串反过来跟正着的相等即可:
class Solution: def judge(self , str ): # write code here if str == str[::-1]: return True else: return False
判断回文
http://www.nowcoder.com/practice/e297fdd8e9f543059b0b5f05f3a7f3b2
使用python非常简单,只要字符串反过来跟正着的相等即可:
class Solution: def judge(self , str ): # write code here if str == str[::-1]: return True else: return False
相关推荐