+ 2
what is the difference between global and non local keywords In python
9 Answers
+ 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