Created
August 27, 2023 22:06
-
-
Save aremu-smog/0d4f2fc58fac4ed3ae128062164a834e to your computer and use it in GitHub Desktop.
Palindrome Checker with Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def isPalindrome(word): | |
| word_lowercase = word.lower() | |
| word_array = word_lowercase.split(' ') | |
| word_reverse = ' '.join(reversed(word_array)) | |
| return word_lowercase == word_reverse | |
| def main(): | |
| print("****************************") | |
| print("**✅ PALINDROME CHECKER ❌***") | |
| print("****************************") | |
| word = input("Enter a word: ") | |
| if (isPalindrome(word)): | |
| print(f"💃 '{word}' is a palindrome") | |
| else: | |
| print("Not a palindrome") | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment