I am a beginner learning python. Right now I am trying to create a code that tells me if a string that was entered by the user is the same backwards. Ex. Hannah, Ana , stats. You get the idea.
This is my code so far. I am trying to figure out why I am not able to check further than the first and last index of the string also would like to get some advice in how to continue because i am stuck. Thank you.
Word = input(“ Enter a word “)
X = 0
Y = len(word)-1
a = word[X]
b = word[Y]
If a == b:
X += 1
Y = Y-1
Print(“is palindrome”)
Else:
Print(“is not palindrome”)