Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "What is the word you would like to check?" # Asks the user what word they would like to check.
- x = raw_input("> ") # User inputs the word.
- y = x[::-1] # reverses the string.
- if x.lower() == y.lower(): # checks if the strings match, this way it handles case sensitivity.
- print x,"is a palindrome!" # prints it is a palindrome
- else: # and if it's not a palindrome
- print x,"is not a palindrome!" # it will print it is not a palindrome!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement