Discuss / Python / 要用Student.count而不是self.count

要用Student.count而不是self.count

Topic source

遥望君山

#1 Created at ... [Delete] [Delete and Lock User]
class Student(object):
    count = 0

    def __init__(self, name):
        self.name = name
        Student.count += 1

  • 1

Reply