course_1_assessment_12
题目:Below are a set of scores that students have received in the past semester. Write code to determine how many are 90 or above and assign that result to the value a_scores.
scores = “67 80 90 78 93 20 79 89 96 97 92 88 79 68 58 90 98 100 79 74 83 88 80 86 85 70 90 100”
scores = scores.split()
a_scores = 0
for score in scores:
if int(score) >= 90:
a_scores = a_scores + 1
print(a_scores)
本文介绍了一段用于统计学生成绩中90分及以上分数数量的Python代码。通过将成绩字符串转换为列表,然后遍历每个成绩,使用条件语句检查成绩是否大于等于90分,如果是,则增加计数器的值。最后,打印出90分以上的成绩数量。
1063

被折叠的 条评论
为什么被折叠?



