Skip to content

Instantly share code, notes, and snippets.

@JMScheiner
Created May 7, 2013 01:02
Show Gist options
  • Save JMScheiner/5529560 to your computer and use it in GitHub Desktop.
Save JMScheiner/5529560 to your computer and use it in GitHub Desktop.
# Version 1
palindromic = lambda s: (not s) or (s[0] == s[-1] and palindromic(s[1:-1]))
# Version 2
def palindromic(s):
return (not s) or (s[0] == s[-1] and palindromic(s[1:-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment