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

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

专题博客链接



原题题目

在这里插入图片描述



代码实现

numbers = int(input());sum = count = 0 if(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/

你可能感兴趣的文章
phpstorm中Xdebug的使用
查看>>
phpstorm中使用svn版本控制器
查看>>
PHPStorm使用git
查看>>
PHPstorm最常用的快捷键,提高开发效率
查看>>
Redis五种数据结构
查看>>
phpstorm配置php脚本执行
查看>>
PhpStorm配置远程xdebug
查看>>
phpstudy+iis搭建php项目
查看>>
phpStudy安装教程
查看>>
phpstudy搭建网站,通过快解析端口映射外网访问
查看>>