Created
April 20, 2018 17:48
-
-
Save mightywombat/632432cfd9fd281e4e7c5f35cce7c028 to your computer and use it in GitHub Desktop.
practicepython.org Ex 06
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
# practicepython.org Ex 06 | |
word_og = raw_input("Palindrome checker. Enter your palindrome: ") | |
word = word_og.replace(" ", "") | |
start = 0 | |
while (len(word) / 2) > start: | |
end = -(start + 1) | |
if word[start] == word[end]: | |
start += 1 | |
print ("So far so good...") | |
else: | |
print ("You are not a winner.") | |
break | |
if start >= (len(word) / 2): | |
print ("Surprisingly, this is a palindrome. What are the chances?") | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment