I'm new to python, there are many concepts I still trying to understand. Can anyone explain me why this is the case?
def func(x):
x = 3
return
x = 1
print x
func(x)
print x
OUTPUT:
1
1
But, if x is a list:
def func(x):
x[0] = 3
return
x = [1]
print x
func(x)
print x
OUTPUT:
[1]
[3]
Why?