KnowledgeBoat Logo

Computer Science

A local variable having the same name as that of a global variable, hides the global variable in its function.

Python Functions

2 Likes

Answer

True

Reason — Inside a function, you assign a value to a name which is already there in a global scope, Python won't use the global scope variable because it is an assignment statement and assignment statement creates a variable by default in current environment. That means a local variable having the same name as that of a global variable, hides the global variable in its function.

Answered By

1 Like


Related Questions