我越來越與功能相混淆,因爲我剛纔想使用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