def eliminate(w): tmp = "" for i in w: if i.isalnum(): tmp = tmp + i.lower() return tmp word = input("Give me a word:") word = eliminate(word) reverse = "" for i in word: reverse = i + reverse print(reverse) if word == reverse: print("This is a palindrome") else: print("This is not a palindrome") |
Silver Announcements >