def test1(data):
data += 1
print data
a = 1
print a
test1(a)
print a
输出:
1
2
1
def test2(data_list):
data_list[0] += 10
print data_list
tmplist = [1, 2, 3]
print tmplist
test2(tmplist)
print tmplist
输出:
[1, 2, 3]
[11, 2, 3]
[11, 2, 3]