校园好声音大赛,三位选手得分,由8位评委给出。
请根据评分表,将每们选手的得分去掉一个最高分和一个最低分后求平均分,并按照平均分由高到低输出选手编号和最后得分。
dicScores = {'012': [90, 94, 97, 86, 85, 89, 88, 85], '005': [91, 91, 92, 98, 90, 96, 90, 95], '108': [96, 86, 97, 96, 87, 86, 86, 96]} dicAve = {} lists = [] for k, v in dicScores.items(): lists = dicScores[k] lists.remove(max(lists)) lists.remove(min(lists)) ave = sum(lists) / len(lists) dicAve[ave] = k print(dicAve) ls = sorted(dicAve, reverse=True) print(ls) for k in ls: print(dicAve[k], k)
125jz网原创文章。发布者:江山如画,转载请注明出处:http://www.125jz.com/4638.html