Given following code:
def A() : b = 1 def B() : # I can access \'b\' from here. print( b ) # But can i modify \'b\' here? \'
You can, but you'll have to use the global statment (not a really good solution as always when using global variables, but it works):
def A(): global b b = 1 def B(): global b print( b ) b = 2 B() A()