Created
September 26, 2013 14:50
-
-
Save minichate/6715304 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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