我的代码是:
a = {"a1","a2","a3"}
b = a
b[1] = "b1"
print(a[1])
我无法理解为什么结果是" b1"而不是" a1"。
同样是:
a = {"a1","a2","a3"}
b = a
c = b
b[1] = "b1"
c[2] = "c2"
print(a[1])
print(a[2])
print(a[3])
结果将是: " B1" " C2" " A3"
我可以用其他方式复制变量吗?