Пожалуйста, помогите мне понять результат примера № 1-B:
Пример № 1-A:
ref=[3,5,9]
c=ref[:]
c[1]=0
# c equals to [3,0,9], and ref equals to [3, 5, 9]
Пример № 1-B:
ref=[[1,2],[3,4]]
c=ref[:]
c[0][1]=0
# c equals to [[1, 0], [3, 4]], and ref equals to [[1, 0], [3, 4]]
Пример # 2-A:
ref=[3,5,9]
c=copy.deepcopy(ref)
c[1]=0
# c equals to [3, 0, 9], and ref equals to [3, 5, 9]
Пример # 2-B:
ref=[[1,2],[3,4]]
c=copy.deepcopy(ref)
c[0][1]=0
# c equals to [[1,0],[3,4]], and ref equals to [[1,2],[3,4]]