for i in list1:
dict.update({i:[1, 0, 0, 0, 0, 0, 0, 0, 0]})
print(i,dict[i])
结果:
[1, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 0, 0]
update里面不能用=,得用{}