Created
May 23, 2017 19:05
-
-
Save dluciano/06270c159449118156f34860a2b36b66 to your computer and use it in GitHub Desktop.
Palindrome Recursive - Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def palindromeR(text): | |
M = len(text) | |
if(M <= 1): | |
return True | |
return (text[0] == text[M - 1]) and palindromeR(text[1: M - 1]) | |
n = "racecare" | |
isP = palindromeR(n) | |
print(isP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not case sensitive