CodeOS / 编程实验

AI 交互式编程实验室

比较两种代码写法,看看程序状态和输出为什么会变。

Pythonshallow_copy.py
a = [[1], [2]]
b = a.copy()
b[0].append(99)
print(a)

文章