Python程序:统计学生成绩平均分和不及格人数
n = int(input()) scores = [] count = 0 for i in range(n): score = int(input()) scores.append(score) if score < 60: count += 1 average = sum(scores) / n print('平均分为:{:.2f},有{}个学生不及格。'.format(average, count))
原文地址: https://www.cveoy.top/t/topic/ohKi 著作权归作者所有。请勿转载和采集!