求改正,循环三层,加上了list中的每个元素
d = {
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
l = ([50, 61, 66],[80, 61, 66],[88, 75, 90])
n = ['Alice','Bob','Candy']
for x in n:
for y in l:
for z in y:
d[x].append(z)
print(d)
d = {
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
l = ([50, 61, 66],[80, 61, 66],[88, 75, 90])
n = ['Alice','Bob','Candy']
for x in n:
for y in l:
for z in y:
d[x].append(z)
print(d)
2021-12-09
举报