An empty class is a class that does not have any code defined within its block. In Python, we create an empty class by the keyword “pass”. The pass is a special statement in Python that does nothing. It only works as a dummy statement. However, objects of an empty class can also be created.
# Python program to demonstrate
# empty class
class Aticleworld:
pass
# Driver's code
obj = Aticleworld()
print(obj)
Answer:
An empty class is a class that does not have any code defined within its block. In Python, we create an empty class by the keyword “pass”. The pass is a special statement in Python that does nothing. It only works as a dummy statement. However, objects of an empty class can also be created.
Output:
__main__.Aticleworld object at 0x7fcc56a0d518>
need an explanation for this answer? contact us directly to get an explanation for this answer