How to create a Class using type in Python?
The type keyword used to create a new class on the fly and then instantiate it.
e1 = type('Employee', (), {})() print(e1) e1.name = "John Doe" print(e1.name)
Sample output of above program.
<__main__.Employee object at 0x0000000002DCC780> John Doe
2019-06-23T11:54:53+05:30
2019-06-23T11:54:53+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution