A.) def outer():
x=“local”
def inner():
print(x)
inner()
print(x)
B.)def outer():
x=10
def inner():
nonlocal x
x+=5
print(x)
inner()
print(x)
In case A we don’t require " nonlocal " keyword in it but in case B we require “nonlocal” keyword . they both are placed at same place in the code . is there any difference for using "nonlocal " keyword for string and inegers .
my question Is why in case A "nonlocal " keyword not used ?