Question 8
Back to Exercise
In what order does Python look up a name?
- A Local, Enclosing, Global, Built-in Correct
- B Global, Local, Built-in, Enclosing
- C Built-in, Global, Enclosing, Local
- D Local, Global only
Correct Answer: Option A
The first scope that has the name wins, which is how a local variable can hide a global or a built-in.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!