Created
May 23, 2016 21:57
-
-
Save demian711/f72b9fac4f94a8a610b2d16750603cbf 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
#Ask the user for a string and print out whether this string is a palindrome or not. | |
string = str(raw_input("Give me a string: ")) | |
def reverse_string(to_be_reversed): | |
return to_be_reversed[::-1] | |
reversed = reverse_string(string) | |
if reversed == string: | |
print "%s is palindrome!!!" % string | |
else: | |
print "%s is not palindrome" % string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment