Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check palindrome in python using recursion

def isPalindrome(string):
  	#termination condition: the string is one character or less
    if (len(string) <= 1):
        return True
    if (string[0] == string[-1]):
        return isPalindrome(string[1:-1])
    else:
        return False
 
PREVIOUS NEXT
Tagged: #check #palindrome #python #recursion
ADD COMMENT
Topic
Name
2+9 =