为什么这样结果是0
class A():
__count=0
def __init__(self):
__count=1
@classmethod
def get_count(cls):
return cls.__count
pass
B=A()
print(A.get_count())
class A():
__count=0
def __init__(self):
__count=1
@classmethod
def get_count(cls):
return cls.__count
pass
B=A()
print(A.get_count())
2024-12-28
举报