代码量还可以缩减吗?
# coding=utf-8
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for key, value in d.items():
for index in range(len(value)):
print("{}的第{}次成绩是{}分".format(key,index+1,value[index]))
# coding=utf-8
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for key, value in d.items():
for index in range(len(value)):
print("{}的第{}次成绩是{}分".format(key,index+1,value[index]))
2020-10-18
举报