小册名称:Python合辑13-面向对象编程案例(上)
e1 = type('Employee', (), {})()print(e1)e1.name = "John Doe"print(e1.name)
e1 = type('Employee', (), {})()
print(e1)
e1.name = "John Doe"
print(e1.name)
Output:
<__main__.Employee object at 0x0000000002DCC780>John Doe
<__main__.Employee object at 0x0000000002DCC780>
John Doe