预测统计器的输出
下面程序先跳过无效的负数,再对有效成绩求平均(取整数)。运行它,填写结果。
scores = [80, -1, 90]
total = 0
count = 0
for s in scores:
if s >= 0:
total = total + s
count = count + 1
print(total // count)
下面程序先跳过无效的负数,再对有效成绩求平均(取整数)。运行它,填写结果。
scores = [80, -1, 90]
total = 0
count = 0
for s in scores:
if s >= 0:
total = total + s
count = count + 1
print(total // count)
全部评论