私信  •  关注

Suraj Kumar

Suraj Kumar 最近回复了
5 年前
回复了 Suraj Kumar 创建的主题 » python3.7-名称错误:未使用定义名称“paul”

到目前为止,您可以检查下面的代码来更正语法。记住这一点 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