# -*- 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)