Skip to content

Instantly share code, notes, and snippets.

@saleph
Last active August 29, 2015 14:25
Show Gist options
  • Save saleph/3374479342053e1bb9de to your computer and use it in GitHub Desktop.
Save saleph/3374479342053e1bb9de to your computer and use it in GitHub Desktop.
simple palindrome checker
__author__ = 'tom'
def palindrome(word):
if all(word[x] == word[len(word)-x-1] for x in range(0, len(word)/2)):
return True
else:
return False
print(palindrome("mock"))
print(palindrome("lol"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment