方法一:
scores = [91, 95, 97, 99, 92, 93, 96, 98]
scores2 = []
avg = sum(scores) / len(scores)
print('平均成绩是:{}'.format(avg))
for i in scores:
if i avg># 少于平均分的成绩放到新建的空列表中
scores2.append(i)
print('低于平均成绩的有:{}'.format(scores2))
方法二:
导入函数库
import numpy as np # 导入 numpy库,as 即为导入的库起一个别称,别称为np
scores1 = [91, 95, 97, 99, 92, 93, 96, 98]
scores2 = []
average = np.mean(scores1) # 一行解决。
print('平均成绩是:{}'.format(average))
# 下面展示一种NumPy数组的操作,感兴趣的同学可以自行去学习哈。
scores3 = np.array(scores1)
print('低于平均成绩的有:{}'.format(scores3[scores3
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/fc1f4134970a304e497cad6cc3c8a786c8175ccd?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_450%2Ch_600%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
23年二级建造师-新考季备考指导课
精编干货 高效通关
¥1元/科
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/c9fcc3cec3fdfc031027ee2ec63f8794a5c226cc?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_450%2Ch_600%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
23年一级建造师-备考资料大礼包
备考提速 精华知识点
¥1元/科
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/37d12f2eb9389b50e12111c29735e5dde6116e40?x-bce-process%3Dimage%2Fresize%2Cm_lfit%2Cw_450%2Ch_600%2Climit_1%2Fquality%2Cq_85)
2021一级造价师-密训抢分
密训抢分冲刺
¥0元
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/58ee3d6d55fbb2fb96c53c725f4a20a44723dce0?x-bce-process=image/resize,m_lfit,w_450,h_600,limit_1/quality,q_85)
2021一消名师100节精品课
超值体验,轻松取证
¥0元
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/267f9e2f070828385cb92d84aa99a9014d08f1ee?x-bce-process%3Dimage%2Fresize%2Cm_lfit%2Cw_450%2Ch_600%2Climit_1%2Fquality%2Cq_85)
2021年中级经济师-强化进阶体验课
知己知彼,三步破局
¥1元
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/03087bf40ad162d9a278948c03dfa9ec8b13cd88?x-bce-process%3Dimage%2Fresize%2Cm_lfit%2Cw_450%2Ch_600%2Climit_1%2Fquality%2Cq_85)
2022年高级经济师-基础重塑课
基础重塑 高效备考
¥0元
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/eac4b74543a98226537f4d479a82b9014a90eb10?x-bce-process=image/resize,m_lfit,w_450,h_600,limit_1/quality,q_85)
2021健康管理师超值教程大礼包
教程课题一站式配齐
¥39元
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/342ac65c103853430470e1418313b07eca808817?x-bce-process=image/resize,m_lfit,w_450,h_600,limit_1/quality,q_85)
四级人力资源管理师-备考指导
轻松入门人力资源师
¥0元
查
看
更
多
在线客服官方服务官方网站精华资料免费直播课免费领课领优惠券考试日历