博客
关于我
浙大Python 第4章-7 统计学生平均成绩与及格人数 (15 分)
阅读量:181 次
发布时间:2019-02-28

本文共 347 字,大约阅读时间需要 1 分钟。

专题博客链接



原题题目

在这里插入图片描述



代码实现

numbers = int(input());sum = count = 0if(numbers == 0): print("average = 0.0\ncount = 0" )else:    nums = list(input().split())    for i in range(numbers):        if(int(nums[i]) >= 60): count+=1        sum += int(nums[i])    if(numbers != 0):        print("average = %.1f" %(sum/numbers))        print("count = %d" %(count))


提交结果

在这里插入图片描述

转载地址:http://twni.baihongyu.com/

你可能感兴趣的文章
mysql整库导入、导出
查看>>
mysql文本函数和数字函数
查看>>
Mysql新建用户和数据库并授权
查看>>
mysql日志文件
查看>>
mysql日志管理学习笔记
查看>>
mysql日志问题定位实用命令
查看>>
MySQL日期时间函数大全
查看>>
mysql时间相减的问题
查看>>
mysql时间表示和计算
查看>>
mysql更新一个表里的字段等于另一个表某字段的值
查看>>
Mysql更新时间列只改日期为指定日期不更改时间
查看>>
MySQL更新锁(for update)摘要
查看>>
mysql替换表的字段里面内容
查看>>
MySQL最大建议行数 2000w,靠谱吗?
查看>>
MySQL有哪些锁
查看>>
MySQL服务器安装(Linux)
查看>>
mysql服务器查询慢原因分析方法
查看>>
mysql服务无法启动的问题
查看>>
MySQL杂谈
查看>>
mysql权限
查看>>