ITP

BSc IT - Programming in Python

What is namespace in python ? list out

In : BSc IT Subject : Programming in Python

A 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

About us

A truly open platform where you may ask questions and get answers. We also provide comprehensive and easy-to-understand answers to question papers.  discover...

Site status

Flag Counter

Privacy Policy

Sitemap