python菜鸟学习: 3.浅copy使用场景
作者:互联网
# -*- coding: utf-8 -*-
import copy
# 浅copy
# 使用场景,比如A,B夫妻共有一个银行账户,存取马宁的数据
username = ["name", ["saving", 1000]]
zhangsan = copy.copy(username)
zhangfuren = copy.copy(username)
print(zhangfuren)
print(zhangsan)
zhangfuren[1][1] = "20000"
print(zhangfuren)
print(zhangsan)
标签:username,zhangfuren,场景,python,菜鸟,print,copy,zhangsan 来源: https://www.cnblogs.com/liyuzhoupan/p/16580310.html