定义一个类,在实例化的时候,抛出NameError异常

小甘要努力了 / 2023-08-07 / 原文


代码1:

class cla: def __init__(self): #raise NameError # 抛出异常 print(r) cla()

运行截图: