Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input = input("Please enter a word: ")
- text = input.casefold()
- revtxt = text[::-1] #I learned this method of reversing text from GeeksforGeeks.org
- print(text+" in reverse is "+revtxt)
- # check if the string is equal to its reverse
- if text == revtxt:
- print("It is a palindrome")
- else:
- print("it is not a palindrome")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement