python列表复制大概有三种,
import copy
a = ['a',['boy','girl'],'blue',520]
b = a
c = a.copy()
d = copy.deepcopy(a)
print ("{}的id是{}".format('a',id(a)))
print ("{}的id是{}".format('b',id(b)))
print ("{}的id是{}".format('c',id(c)))
print ("{}的id是{}".format('d',id(d)))
#a的id是3072388204
#b的id是3072388204
#c的id是3072406604
#d的id是3072060940
b[0] = 'aaa'
print (a)
#['aaa', ['boy', 'girl'], 'blue', 520]
c[0] = 'aaa'
c[1][0] = 'bbb'
print (a)
#['a', ['bbb', 'girl'], 'blue', 520]
d[1][0] = 'bbb'
print (a)
#['a', ['boy', 'girl'], 'blue', 520]