scores = {"小刘": 45, "小红": 68, "小米": 96, "小白": 65, "小梦": 75} highest = max(scores.values()) lowest = min(scores.values()) average = sum(scores.values()) / len(scores) # print("平均值为:"+str(average)) max_keys = [k for k, x in scores.items() if not any(y > x for y in scores.values())] print('成绩最高的是:') for student in max_keys: print(student) min_keys = [k for k, x in scores.items() if not any(y < x for y in scores.values())] print('成绩最低的是:') for student in min_keys: print(student) personName = [k for k, v in scores.items() if v < average] print("低于平均值的学生:") for student in personName: print(student)