我正在研究一個BMI計算器,併爲它的「狀態」部分提供了一堆if語句。出於某種原因,我通過Eclipse發現錯誤「預計:)」,但我不知道缺少什麼。Python if語句的語法?
這裏是拋出錯誤的代碼示例:
BMI = mass/(height ** 2)
if(BMI < 18.5):
status = "Underweight"
if(BMI => UNDERWEIGHT and BMI < NORMAL):
status = "Normal"
if(BMI => NORMAL & BMI < OVERWEIGHT):
status = "Overweight"
elif(BMI >= 30):
status = "Obese"
你在哪裏看到這個錯誤 –