+ 2
what is the difference between global and non local keywords In python
8 Réponses
+ 2
Nonlocal variables are used in nested functions whose local scope is not defined. This means that the variable can be neither in the local nor the global scope.
For more information please visit-:
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/ref_keyword_nonlocal.asp
+ 1
Akash Agrawal
thanks for helping me
it really helps
+ 1
The nonlocal statement does to enclosing scope variable what global statement does to the global variable. The nonlocal is a counterpat of the global statement. Afer calling func() the value of 'gb' and 'esv' are changed even outisde the local scope.
0
thanks for your response....
but I am not asking between global and local variables..
I need difference between global and nonlocal keywords
I hope u understand my qns
0
Kon
- 1
Ok
- 1
Kab rat ko ha free
- 1
Ashutosh