from numpy import *
Chengji=[68,75,32,99,78,45,88,72,83,78]
Chengji.sort(reverse=True)
Youxiu=[]
Lianghao=[]
Zhongdeng=[]
Chasheng=[]
while True:
c=int(input('请输入一个成绩:'))
if c in Chengji:
print('成绩的排名为:',Chengji.index(c)+1)
else:
print('该成绩不在列表中')
break
for i in Chengji:
if 90<i<100:
Youxiu.append(i)
elif 80<i<89:
Lianghao.append(i)
elif 60<i<79:
Zhongdeng.append(i)
else:
Chasheng.append(i)
Youxiu.sort()
Lianghao.sort()
Zhongdeng.sort()
Chasheng.sort()
print('等级优共:'+str(len(Youxiu))+'人,成绩由低到高为:',Youxiu)
print('等级良共:'+str(len(Lianghao))+'人,成绩由低到高为:',Lianghao)
print('等级中共:'+str(len(Zhongdeng))+'人,成绩由低到高为:',Zhongdeng)
print('等级差共:'+str(len(Chasheng))+'人,成绩由低到高为:',Chasheng)
a,*c,b=Chengji
print('去掉最高分和最低分的平均分为:',mean(c))
如果对你由帮助,帮忙采纳下,多谢!