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

  1. class Employee:
  2. pass
  3. e1 = Employee()
  4. print(e1)
  5. e1.name = "John Doe"
  6. print(e1.name)

Output:

  1. <__main__.Employee object at 0x0000000002DA51D0>
  2. John Doe

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