Created
October 8, 2010 19:14
-
-
Save colegleason/617358 to your computer and use it in GitHub Desktop.
what is this i don't even
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
text = open('gettysburg.txt','r').read() | |
for x in reversed(range(len(text))): | |
print "Now on length " + str(x) | |
done = False | |
substring = text[0:x] | |
for i in range((len(text) + 1) - x): | |
print "Now on position " + str(i) | |
if x+i <= len(text): | |
substring = text[0+i:x+i] | |
if substring == substring[::-1]: | |
print substring | |
done = True | |
break | |
else: | |
pass | |
if done: break | |
else: pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment