533 Views
What is scope resolution in python Language
Answer (1)
A scope is a block of code where an object in Python remains relevant.Each and every object of python functions within its respective scope.As Namespaces uniquely identify all the objects inside a program but these namespaces also have a scope defined for them where you could use their objects without any prefix. It defines the accessibility and the lifetime of a variable.
Let’s have a look on scope created as the time of code execution:
- A local scope refers to the local objects included in the current function.
- A global scope refers to the objects that are available throughout execution of the code.
- A module-level scope refers to the global objects that are associated with the current module in the program.
- An outermost scope refers to all the available built-in names callable in the program.
Related Questions
TMV, Pune | M.Sc Computer App...
Apply
2-year postgraduate program focusing on advanced computing and IT applications
Chandigarh University Admissi...
Apply
Ranked #1 Among all Private Indian Universities in QS Asia Rankings 2025 | Scholarships worth 210 CR
Amity University Noida B.Tech...
Apply
Among Top 30 National Universities for Engineering (NIRF 2024) | 30+ Specializations | AI Powered Learning & State-of-the-Art Facilities
Shoolini University Admission...
Apply
NAAC A+ Grade | Ranked No.1 Private University in India (QS World University Rankings 2025)