English

Give examples of namespaces with respect to Python.

Advertisements
Advertisements

Question

Give examples of namespaces with respect to Python.

Short Answer
Advertisements

Solution

Examples of namespaces in Python:

  • Built-in namespace — contains names such as print, len, max, etc.
  • Global namespace — contains names created at the top level of a module/program.
  • Local namespace — contains names created inside a function when it is called.
  • Class/instance namespace — contains attributes and methods of a class or an object.
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Classes in Python - EXERCISE [Page 62]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 3 Classes in Python
EXERCISE | Q 2. b. | Page 62
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×