Open In App

Python | Namespaces and Scope Quiz | Question 6

What will happen if a variable with the same name is defined both locally and globally in Python?

(A)



The local variable takes precedence

(B)



The global variable takes precedence

(C)

It will result in an error

(D)

Both variables can be used interchangeably

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

Article Tags :
Uncategorized