diff --git a/palindrome_checker/palindrome_checker.py b/palindrome_checker/palindrome_checker.py new file mode 100644 index 0000000..db31f45 --- /dev/null +++ b/palindrome_checker/palindrome_checker.py @@ -0,0 +1,13 @@ + +if __name__ == "__main__": + import re + + word = input("Enter the word you think is a palindrome: ") + + #Remove spaces and punctuation so phrases work as well + clean_word = re.sub(r'\W', "", word) + + if clean_word.lower() == clean_word[::-1].lower(): + print("That's a palindrome!") + else: + print("Not a palindrome")