【发布时间】:2022-10-07 09:48:52
【问题描述】:
我对编程相当陌生,并且在我的第一堂课的期末考试中,但我遇到了这个问题,我似乎无法弄清楚为什么。我在该行使用的语法是有效的语法,我查看了上面的行并没有发现任何问题,所以我不确定为什么会出现此错误。
#Prompt user for # of rooms
print(\"Hello! Please follow the prompts on screen for the services listed:\\n\")
numRooms = eval(input(\'How many rooms will be cleaned? Note: No more than 10 rooms!\\n\'))
while(numRooms > 10 or <= 0):
print(\"***Invalid number of rooms***\\n\")
numRooms = eval(input(\'How many rooms will be cleaned? Note: No more than 10 rooms!\\n\'))
(另外,第一次使用堆栈溢出,所以如果我表现得无知,我很抱歉)
-
如果这是决赛,那么您确定您可以在 Stack Overflow 上寻求帮助吗?
-
我不明白为什么不,我会联系教授,但他并没有真正回应。我查看了学习资源,并自行研究了它,但无济于事。
-
while(numRooms > 10 or <= 0)不是有效的 Python 语法。
标签: python syntax-error