Python基本类型与引用类型
>>> a=1
>>> a
1
>>> b
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
b
NameError: name 'b' is not defined
>>> b=a
>>> b
1
>>> b=b+1
>>> b
2
>>> a
1
>>> a=['a','b']
>>> a
['a', 'b']
>>> b=a
>>> b
['a', 'b']
>>> b.append('c')
>>> b
['a', 'b', 'c']
>>> a
['a', 'b', 'c']
>>>
>>> a
1
>>> b
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
b
NameError: name 'b' is not defined
>>> b=a
>>> b
1
>>> b=b+1
>>> b
2
>>> a
1
>>> a=['a','b']
>>> a
['a', 'b']
>>> b=a
>>> b
['a', 'b']
>>> b.append('c')
>>> b
['a', 'b', 'c']
>>> a
['a', 'b', 'c']
>>>