python字典中列表追加数据

dict = {}

for i in range(1, 6):
if i not in dict:
dict[i] = []
for j in range(101, 106):
dict[i].append(j)

print(dict)


猜你喜欢

转载自www.cnblogs.com/WebLinuxStudy/p/11954595.html