InterviewSolution
Saved Bookmarks
| 1. |
What is Scope in Python? |
|
Answer» Every OBJECT in Python functions within a scope. A scope is a block of code where an object in Python remains relevant. Namespaces uniquely IDENTIFY all the objects inside a program. However, these namespaces also have a scope defined for them where you could use their objects without any prefix. A few EXAMPLES of scope CREATED during code execution in Python are as follows:
Note: Local scope objects can be synced with global scope objects using keywords such as global. |
|