Skip to content

Instantly share code, notes, and snippets.

@nsfyn55
Created June 11, 2012 20:08
Show Gist options
  • Save nsfyn55/2912350 to your computer and use it in GitHub Desktop.
Save nsfyn55/2912350 to your computer and use it in GitHub Desktop.
Palidrome checker python
def isPalindrome(s):
return s[0:len(s)/2] == s[len(s) - len(s)/2:len(s)][::-1]
isPalindrome('foof') #true
isPalindrome('fooof') #true
isPalindrome('fooob') #false
isPalindrome('foob') #false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment