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();

python is not defined_第1张图片

你可能感兴趣的:(py,python)