python——录入学生成绩并打印成绩最好的一个学生信息
本系统和上篇博客类似:https://blog.youkuaiyun.com/csdnmgq/article/details/91168287
但是也有一点新的内容
在之前的内容上增加了
1、max函数的使用
2、输出成绩最好的学生信息
同样数据我依然使用列表,,一是想通过两个列子熟悉列表的使用方法,二是偷懒,,你懂的![]()
![]()
代码如下:
print("学生成绩管理系统")
x = 1
line = []
line_all = []
max_score_all = []
while x==1:
num = input("请输入学号:")
name = input("请输入姓名:")
score = input("请输入成绩:")
score = int(score)
if score > 100 or score < 0 :
print("请重新输入0-100的分数,,")
continue
line = [num, name, score]
line_all = line_all+line
max_score = [score]
max_

这篇博客介绍了如何使用Python记录学生的成绩,并利用max函数找出成绩最好的学生信息。文章提到了与前一篇博客的相似之处,同时强调了新增的max函数应用和输出最优成绩学生详情的功能。示例代码中,数据存储在列表中,以此来熟悉列表操作并简化实现。
最低0.47元/天 解锁文章
4206





