【发布时间】:2021-01-17 14:51:08
【问题描述】:
我的老师给我这个作业 “编写一个python程序来读取3名学生的数学、英语和物理的姓名和分数,并根据平均和成绩按降序打印学生的数据。” 他希望我们用这些命令来编写它(循环,如果语句,打印,输入) 没有功能
我被困在这里
for i in range(0, 3):
name = input("enter the student's name: ")
math = int(input("enter the Math mark: "))
eng = int(input("enter the English mark: "))
ph = int(input("enter the Physics mark: "))
Av = ((math + eng + ph) / 3)
print(name, Av, "%")
如何比较循环中输入的值?
【问题讨论】:
-
您好,您现在已经有了答案,您可以考虑accepting an answer 来奖励给您最有帮助的评论。