Advertisements
Advertisements
प्रश्न
Explain the usage of keyword 'pass' in class definition.
स्पष्ट कीजिए
Advertisements
उत्तर
The 'pass' statement is a null statement - it performs no action. It is used when a class body is temporarily empty, because Python requires an indented statement inside a class definition.
class Mobile:
pass
Here, Mobile is an empty class with no attributes or methods.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
