05 字典内存分配

data_list = []
for i in range(10):
    data = {}
    data['user'] = i
    data_list.append(data)
print(data_list)
#每个字典都 不一样

字典,列表内存指向图

data = {}
for i in range(10):
    data['user'] = i
print(data)

内存占用图

posted @ 2024-09-25 21:39  jhchena  阅读(3)  评论(0编辑  收藏  举报