您現在的位置是:首頁 > 標簽 > amountPython 拓展之斷言(assert)cnt -= amountelse:print(‘cnt is not enough’)在上面的程式碼中,我們設定的是 deposit() 和 withdraw() 方法的引數 amount 必須大於零,這裡用的就是斷言,如果不滿足條件的話assertamount異常__self2023-01-07閱讀更多標籤雲陳善明圖書館學魏家外囊時妍安眠八核大鏵子隋飛飛佳沛555km林忠江望潤府銅首硬卡防磨大池孫晉鵬託輪腺嘌呤