I try to write a function for palindrome.below is my code
def ispalindrome(string):
if len(string) <= 1:
return True
else:
if string[0] == string[-1]:
return True
else:
return False
Only one thing I don't understand is one of my results it says "ispalindrome('123321') should return False", and my result for this one is true. I don't know what to do now. Anyone can help me correct this?