当前位置:  首页>> 技术小册>> Python合辑13-面向对象编程案例(上)

  1. class Employee:
  2. salary = 10000
  3. name = "John Doe"
  4. emp1 = Employee()
  5. print(emp1.salary)
  6. print(emp1.name)

Output:

  1. 10000
  2. John Doe

该分类下的相关小册推荐: