1 # -*- coding: UTF-8 -*-
 2 class Employee:
 3 
 4     def __init__(self, name, salary):
 5         self.name = name
 6         self.salary = salary
 7     
 8     def displayCount(self):
 9         pass
10     def displayEmployee(self):
11         pass

 

"创建 Employee 类的第一个对象"
emp1 = Employee("Zara", 2000)
"创建 Employee 类的第二个对象"
emp2 = Employee("Manni", 5000)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-12-10
  • 2023-03-20
猜你喜欢
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-11-30
相关资源
相似解决方案