这不是整个代码,而是我正在试验的代码,以获得整个代码的解决方案。我还需要一个处理无效字符串输入的答案。为什么此代码不让我检查无效输入
def menu_payment():
burger_count= (input("Please input the number of Racquet Burgers (Cheese Burgers) you would like: "))
if (burger_count !=int) or (burger_count<=0):
print("You must eneter a positive whole number for your order. Please try again.")
menu_payment()
嗨,你好吗 请输入你想要的球拍汉堡(芝士汉堡)的数量:1 你必须为你的订单发出一个正整数。请再试一次。 请输入您想要的球拍汉堡包的数量: – jkc13
发生这种情况时,我跑的代码 – jkc13
对不起,没有空格 – jkc13