Skip to content

Instantly share code, notes, and snippets.

@aremu-smog
Created August 27, 2023 22:06
Show Gist options
  • Select an option

  • Save aremu-smog/0d4f2fc58fac4ed3ae128062164a834e to your computer and use it in GitHub Desktop.

Select an option

Save aremu-smog/0d4f2fc58fac4ed3ae128062164a834e to your computer and use it in GitHub Desktop.
Palindrome Checker with Python
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