Why the variables a, c, d have not changed, but b has changed?
a = 0
b = []
c = []
d = 'a'
def func_a(a):
a += 1
def func_b(b):
b += [1]
def func_c(c):
c = [2]
def func_d(d):
d += 'd'
func_a(a)
func_b(b)
func_c(c)
func_d(d)
print('a = ', a)
print('b = ', b)
print('c = ', c)
print('d = ', d)
I think it has to do with the fact that all variables are global, but I don't understand why b changes then..