origin list:
dic = {'loop': [{'date': 365, '条件': '人群行为', '类型为':'I1'}]}
origin_list = dic['loop']
# origin_list :[{'date': 365, '条件': '人群行为', '类型为':'I1'}]
then I copy origin_list to a new list:
d_copy = origin_list.copy()
change d_copy's value
d_copy[0]['date']='new value'
and origin_list also change!!,Why?
print(origin_list)
# [{'date': 'new value', '条件': '人群行为', '类型为': 'I1'}]
In another case,the origin_list doesn't change:
dd = [123]
d_copy = dd.copy()
d_copy[0]=22
print(dd) # [123]