输入分数,删除最高最低分,输出平均数
list_s = []
score = int(input("请输入分数"))
while score >= 0:
list_s.append(score)
score = int(input("请输入分数"))
list_s.remove(max(list_s))
list_s.remove(min(list_s))
print(sum(list_s) / len(list_s))
输入分数,删除最高最低分,输出平均数
list_s = []
score = int(input("请输入分数"))
while score >= 0:
list_s.append(score)
score = int(input("请输入分数"))
list_s.remove(max(list_s))
list_s.remove(min(list_s))
print(sum(list_s) / len(list_s))