Discuss / Python / 每次修改类属性(类名.),self.的方式(实例调用)

每次修改类属性(类名.),self.的方式(实例调用)

Topic source

www.LC.com

#1 Created at ... [Delete] [Delete and Lock User]

class Student(object):

    count = 0

    def __init__(self, name):

        self.name = name

        Student.count = Student.count + 1


  • 1

Reply