Skip to content

Instantly share code, notes, and snippets.

@minichate
Created September 26, 2013 14:50
Show Gist options
  • Save minichate/6715304 to your computer and use it in GitHub Desktop.
Save minichate/6715304 to your computer and use it in GitHub Desktop.
def isPalindrome(input_string):
def _string_iterator():
_len = len(input_string)
for i in xrange(_len / 2):
yield input_string[i], input_string[_len - i - 1]
for c1, c2 in _string_iterator():
if c1 != c2:
return False
return True
if isPalindrome('abba' * 10000):
print 'Yo dawg, I hear you like palindromes: true'
else:
print '#failwhale: false'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment