我越来越与功能相混淆,因为我刚才想使用if和else 功能,我不能让他们的工作...奇怪,为什么我不断收到错误
def instructions():
print ("Hello, and welcome to the programme")
def getInput(b):
b=int(input("Enter how many bags of Java coffe you have purchased: "))
if b <= 25:
bonus = b + 0:
if b >= 25:
else:
b <= 49:
bonus = b * 0.05:
if b <= 50:
else:
b >= 99:
bonus = b * 0.1:
if b >= 100:
bonus = b * 0.2:
...
instructions()
...
print("")
...
getInput()
的其他上第二行是作为错误提出来的,所以要在靠近顶部的位置标识。 任何帮助将不胜感激。 谢谢。
检查您的缩进和'if else'子句。 – 2014-11-04 12:32:28
这不会运行。缩进是不连贯的。 – khelwood 2014-11-04 12:34:44
你有2个空的'if'块 – 2014-11-04 12:35:10