就是判断一个首尾是否相等
class Solution:
def judge(self , str ):
# write code here
for i in range(len(str)):
if str[i] != str[len(str)-1-i]:
return False
return True
就是判断一个首尾是否相等
class Solution:
def judge(self , str ):
# write code here
for i in range(len(str)):
if str[i] != str[len(str)-1-i]:
return False
return True