palindrome python

n = input("Enter the word and see if it is palindrome: ") #check palindrome
if n == n[::-1]:
    print("This word is palindrome")
else:
    print("This word is not palindrome")

Here is what the above code is Doing:
1. We are taking input from the user and storing it in the variable n.
2. We are checking if the word is equal to the word in reverse order.
3. If the word is equal to the word in reverse order, then it is a palindrome.
4. If the word is not equal to the word in reverse order, then it is not a palindrome.