本篇介紹如何在Python 中使用 assert 敘述,協助程式設計者在開發階段偵測程式臭蟲(bugs)。 ... if __debug__: if not 判斷條件: raise AssertionError(錯誤訊息).
確定! 回上一頁