1.

How is an empty class created in python?

Answer»

An EMPTY class does not have any members defined in it. It is CREATED by using the pass KEYWORD (the pass command does nothing in PYTHON). We can CREATE objects for this class outside the class.
For example-

class EmptyClassDemo: passobj=EmptyClassDemo()obj.name="Interviewbit"print("Name created= ",obj.name)

Output:
Name created = Interviewbit



Discussion

No Comment Found