实例. 如果x 小于0,则引发错误并停止程序: x = -1 if x < 0: raise Exception("Sorry, no numbers below zero"). 运行实例. 定义和用法. raise 关键字用于引发异常。
確定! 回上一頁