python3练习100题——015
原题链接:http://www.runoob.com/python/python-exercise-example15.html
题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。
我的代码:
def fun():
score=int(input("please input the score:"))
if score<60:
grade="C"
elif score<=89:
grade="B"
else:
grade="A" print("%d is grade %s" %(score,grade))
这个if嵌套很容易,就不过多解释啦。
python3练习100题——015的更多相关文章
- python3练习100题——002
因为特殊原因,昨天没有做题.今天继续- 原题链接:http://www.runoob.com/python/python-exercise-example2.html 题目: 企业发放的奖金根据利润提 ...
- python3练习100题——003
今天继续-答案都会通过python3测试- 原题链接:http://www.runoob.com/python/python-exercise-example3.html 题目:一个整数,它加上100 ...
- python3练习100题——004
继续做题-经过python3的测试 原题链接:http://www.runoob.com/python/python-exercise-example4.html 题目:输入某年某月某日,判断这一天是 ...
- python3练习100题——036
原题链接:http://www.runoob.com/python/python-exercise-example36.html 题目:求100之内的素数. 之前有类似的题,所以这次遇到觉得很容易了, ...
- python3练习100题——035
原题链接:http://www.runoob.com/python/python-exercise-example34.html 题目:文本颜色设置. 学习了一下python3 的文本颜色设置. 其实 ...
- python3练习100题——020
原题链接:http://www.runoob.com/python/python-exercise-example20.html 题目:一球从100米高度自由落下,每次落地后反跳回原高度的一半:再落下 ...
- python3练习100题——013
熟悉的水仙花数来了,,,... 原题链接:http://www.runoob.com/python/python-exercise-example13.html 题目:打印出所有的"水仙花数 ...
- python3练习100题——056
题目:画图,学用circle画圆形. 可以用turtle.circle画图. import turtle turtle.setup(0.6,0.6) turtle.pensize(3) turtle. ...
- python3练习100题——050
题目:输出一个随机数. 程序分析:使用 random 模块. import random print( random.randint(1,10) ) # 产生 1 到 10 的一个整数型随机数 pri ...
随机推荐
- (办公)记事本_grep文本搜索命令
参考谷粒学院的linux视频教程:http://www.gulixueyuan.com/course/300/task/7091/show grep文本搜索命令:[是一种强大的文本搜索工具,它能使用正 ...
- [USACO19DEC]Tree Depth P
题意 求逆序对为\(k\)的\(n\)排列中,生成的笛卡尔数,每个位置的深度和.\(n\le 300\) 做法 设\(f_{k}\)为\(n\)排列中逆序对为\(k\)的个数,其生成函数为:\[\pr ...
- STL入门学习中碰到的一些函数
2020.02.10 fill #include<algorithm> vector<int> v{ 1, 2, 3, 3 }; fill(v.begin(), v.end() ...
- pycharm-1
Python 1.4解释器(运行文件) 1.5注释:#单行,ctrl+/ 多行注释 ””” ””” 2.1变量 assert,except:lambda; nonlocal; 2.2数据类 ...
- JAVA 递归线程池测试 ExecutorService / ForkJoinPool
测试工具使用递归的方式获取子进程的Msg消息,目前有2种常用的ExecutorService / ForkJoinPool 为了测试哪种效果较好,我们来写个测试Demo,循环5555555次+1(加锁 ...
- 手动安装 saltshaker-plus 版本选择特别说明(后期重点讲解Docker安装方式)
前后端都建议使用1.12版本
- ssrf漏洞利用(内网探测、打redis)
摘要:存在ssrf漏洞的站点主要利用四个协议,分别是http.file.gopher.dict协议. file协议拿来进行本地文件的读取,http协议拿来进行内网的ip扫描.端口探测,如果探测到637 ...
- PAT (Basic Level) Practice (中文)1087 有多少不同的值 (20 分) (set)
当自然数 n 依次取 1.2.3.…….N 时,算式 ⌊ 有多少个不同的值?(注:⌊ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分.) 输入格式: 输入给出一个正整数 N(2). 输出 ...
- 基于Python接口自动化测试框架(初级篇)附源码
引言 很多人都知道,目前市场上很多自动化测试工具,比如:Jmeter,Postman,TestLink等,还有一些自动化测试平台,那为啥还要开发接口自动化测试框架呢?相同之处就不说了,先说一下工具的局 ...
- DFS-B - Dr. Evil Underscores
B - Dr. Evil Underscores Today, as a friendship gift, Bakry gave Badawy nn integers a1,a2,…,ana1,a2, ...