python is not defined

name "" is not defined

缩进一定要注意 ,实例化的时候,靠在最左边

不然会认为 class Employee 还未结束

class Employee:

    empCount = 0

    def __init__(self,name,salary):
        self.name = name
        self.salary = salary
        Employee.empCount += 1

    def displayCount(self):
        print(Employee.empCount)

    def diaplayEmployee(self):
        print('传CASCAS啊')

    t = Employee("ssss", 520)
    t.diaplayEmployee();


版权声明:本文为weixin_40828023原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。