x = 10
def add_nums():
y = 2
z = x + y
print z
Function namespace
Global namespace
Object namespace
Class namespace
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The correct answer is Global namespace.
In the provided code, the variable `x` is defined outside of the `add_nums()` function, making it part of the global namespace. This means it can be accessed inside the function. The variable `y` is defined within `add_nums()`, giving it function-local scope, while `z` is also local to that function. Therefore, `x` belongs to the global namespace, which is accessible from anywhere in the program. If you have more questions or need further clarification, feel free to ask!