Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dluciano
Created May 23, 2017 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dluciano/06270c159449118156f34860a2b36b66 to your computer and use it in GitHub Desktop.
Save dluciano/06270c159449118156f34860a2b36b66 to your computer and use it in GitHub Desktop.
Palindrome Recursive - Python 3
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)
@dluciano
Copy link
Author

Not case sensitive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment