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 asprint,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?
