word = input("Give me a sentence:") tmp = "" for i in word: if i.isalnum(): tmp = tmp + i.lower() word = tmp s = "" for i in word: s = i + s print(s) print(word) if s == word: print("This is a palindrome") else: print("This is not a palindrome") |
Bronze Announcements >