输出以后格式还是不行,怎么能调整成 姓名+成绩的样子呢?
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49,
'Gaven': 86
}
AA = ('Alice', 'Bob', 'Candy', 'Mimi', 'David')
for i in AA:
if i in d:
print(i,d[i])
else:
print(i+'null')
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49,
'Gaven': 86
}
AA = ('Alice', 'Bob', 'Candy', 'Mimi', 'David')
for i in AA:
if i in d:
print(i,d[i])
else:
print(i+'null')
2022-11-21
举报