📌  相关文章
📜  try: if '1' != 1: raise "someError" else: print("someError has not occurred") except "someError": print ("someError has occurred") - Python代码示例

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

代码示例1
try:
    if '1' != 1:
        raise "someError"
    else:
        print("someError has not occurred")
except "someError":
    print ("someError has occurred")