Open In App

Python | Namespaces and Scope Quiz | Question 4

Which of the following statements is true regarding the scope of a variable in Python?

(A)



Local variables can be accessed globally.

(B)



Global variables can be accessed only within the function they are defined.

(C)

Local variables override global variables with the same name.

(D)

Global variables always take precedence over local variables.

Answer: (C)
Explanation:
Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :
Uncategorized