recursive palindrome python code example
Example 1: palindrom python rekursiv
def ispalindrome(word):
return word == word[::-1]
Example 2: palindrom python rekursiv
def ispalindrome(word):
if len(word) < 2: return True
if word[0] != word[-1]: return False
return ispalindrome(word[1:-1])