def car(wheels,bodies,figures): car_by_wheels=wheels//4 car_by_figures=figures/2 if figures//2 >= car_by_wheels and bodies >= car_by_wheels: print(car_by_wheels) elif car_by_wheels >= car_by_figures and bodies >= car_by_figures: print(car_by_figures) elif car_by_wheels >= bodies and car_by_figures >= bodies: print(bodies) else: print("0")print(car(3,29,54))我嘗試了其他一些示例,代碼工作正常,但我不斷收到None. 為什么?
1 回答

溫溫醬
TA貢獻(xiàn)1752條經(jīng)驗(yàn) 獲得超4個(gè)贊
您的函數(shù)沒有顯式返回任何內(nèi)容,因此它隱式返回None
. car(3,29,54)
打印并返回也是如此,None
然后您可以打印它。
添加回答
舉報(bào)
0/150
提交
取消