I have the sample code below:
A = None
class App(object):
def __init__(self, a):
global A
A = a
a = {'x': 1}
print(A) # None
App(a)
print(A) # {'x': 1}
a['x'] = 2
print(A) # {'x': 2} # value change if dictionary
a = 2
print(A) # {'x': 2} # value not change
But I don't know why global A has been change value? Help me know this please