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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
