类 1. 统计一个类被实例了多少次 class A: num = 0 def __init__(self): A.num += 1 a = A() b = A() print(A.num) View Code