📜  python if something exception - Python代码示例

📅  最后修改于: 2022-03-11 14:45:11.203000             🧑  作者: Mango

代码示例1
# Simple example on how to throw an exception if value has a certain value!
x = 10
if x > 5:
    raise Exception('x should not exceed 5. The value of x was: {}'.format(x))