class Student(object):
count = 0
def __init__(self, name):
self.name = name
self.count += 1
Student.count += 1
第一个并不符合描述,学得粗糙了...
Sign in to make a reply
蝉的夏
class Student(object):
count = 0
def __init__(self, name):
self.name = name
self.count += 1