2024-04-24 14:33:19 发布
网友
(我想通过阅读一些教程来学习)
为什么这个非常简单的代码不起作用?你知道吗
x = int(raw_input("Please enter a number")): if x < 10: print x, "is less than 10"
一个可能的问题是:如果您使用的是python3,print x, "is less than 10"应该替换为新的print()方法print(x, "is less than 10)。你知道吗
print x, "is less than 10"
print(x, "is less than 10)
冒号表示在第一行中找不到的代码块,例如循环或条件。您应该删除它,因为它只是一个简单的语句,获取用户输入。你知道吗
一个可能的问题是:如果您使用的是python3,
print x, "is less than 10"
应该替换为新的print()方法print(x, "is less than 10)
。你知道吗冒号表示在第一行中找不到的代码块,例如循环或条件。您应该删除它,因为它只是一个简单的语句,获取用户输入。你知道吗
相关问题 更多 >
编程相关推荐