标签:
深浅copy的联合账户说明:
p = [‘name‘,[‘saving‘,100]]
"""
p1 =copy.copy(p)
p2 = p[:]
p3=list(p)
浅拷贝三方式
"""
person1 = p[:]
person2 = p[:]
print(person1)
print(person2)
person1[0]=‘alex‘
person2[0]=‘fengjiang‘
print(person1)
print(person2)
person1[1][1] = 50
print(person1)
print(person2)
标签:
原文地址:http://www.cnblogs.com/5Sir-py/p/5721138.html