What are the rules for global and local variables in Python?

If you assign a new value to a variable anywhere within the function's body, it is assumed to be local. The variables that are referenced inside a function are known as global.

Suggest An Answer

No suggestions avaliable!

Latest post from Python Interview Questions

Ask Question