到目前为止,您可以检查下面的代码来更正语法。记住这一点
indentation for Python
扮演代码未正确使用的非常重要的角色。你必须在这里使用。
tekst = input("Enter your word: ")
for i in range(len(tekst)):
if tekst[-i] == tekst[-i]:
print(tekst + " is a palindrome word")
else:
print( tekst + " is not a palindrome word")
你可以在这里查看现场演示-
Demo
要知道如何编写程序来检查字符串是否为回文或不使用链接
here