The difference between the python nonlocal keyword and the global keyword
Global keyword, the value of a globally modifiable variable
The free keyword, which identifies a variable as a free variable, can assign new values to immutable types, but is used in closures.
def ceshi():count = 1def ceshi_2(value):nonlocal countcount += 1total = valueprint('ceshi_2:',count)return countprint('ceshi:',count)return ceshi_2a = ceshi()print(a(10))print(ceshi())>>>> ceshi: 1>>>> ceshi_2: 2>>>> 2