Answer:
while True:
s = input("Enter a word: ")
if s != "":
reversed_s = ''.join(reversed(s))
if s == reversed_s:
print(s + " is a palindrome")
else:
print(s + " is not a palindrome")
else:
break
Step-by-step explanation:
- Initialize a while loop that iterates until the user enters an empty string
- Ask the user to enter a word
- If the word is not empty, reverse the word
- Check if reversed word is same as the original word. If they are same, then the word is a palindrome. If they are not same, then the word is not a palindrome.