Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save HandsonMatheus/2171430678c074e5c0bb5ae5d6f69e0b to your computer and use it in GitHub Desktop.
Save HandsonMatheus/2171430678c074e5c0bb5ae5d6f69e0b to your computer and use it in GitHub Desktop.
def palindrome(word):
return word == word[::-1]
input_word = input("Enter a word: ")
if palindrome(input_word):
print("The word is a palindrome")
else:
print("The word is not a palindrome")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment