मराठी

Explain the usage of keyword 'pass' in class definition.

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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Classes in Python - EXERCISE [पृष्ठ ६२]

APPEARS IN

सीबीएसई Computer Science with Python [English] Class 12
पाठ 3 Classes in Python
EXERCISE | Q 6. | पृष्ठ ६२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×