What is namespace in python ? list out
In : BSc IT Subject : Programming in PythonA namespace in Python is a naming system to avoid name conflicts. It maps names to objects. Types include built-in, global, enclosing, and local namespaces. Each scope has its own namespace. This helps organize variables and functions in different contexts like modules, functions, or loops.
Built-in Namespace - Contains built-in functions and exceptions (like print(),len())
Global Namespace - Names defined at the top level of a module or script
Enclosing Namespace - Names in the outer function (for nested functions)
Local Namespace - Names inside a function or block