当前位置:网站首页>A program for judging the result of cyclic input
A program for judging the result of cyclic input
2022-07-28 16:15:00 【Siege lion Yimu】
I don't say much nonsense , Go straight to the code :
i =5 # Definition i
while i>2:
i = i-1 # Satisfy while Condition rule i reduce 1
a = eval(input(" Please enter the grade :"))
if a<0 or a>100 or a%1 != 0:
print(" The score you entered is unreasonable , Please check and re-enter ")
elif 90 <= a <= 100:
print(" Your grade :A")
elif 80<= a < 90:
print(" Your grade :B")
elif 70<= a < 80:
print(" Your grade :C")
elif 60<= a < 70:
print(" Your grade :D")
else:
print(" Your grade :E")
The operation results are as follows :
Please enter the grade :90
Your grade :A
Please enter the grade :60
Your grade :D
Please enter the grade :40
Your grade :E
>>>
The knowledge points are as follows :
1:while Syntax and usage of sentences :
while <condition> Conditional statements :
<execute statement> Execute statement
Parameter description
condition: For conditional statements , Used to set the conditions of the loop , Can be equal to 、 Comparison, etc . such as a==3、a>2. When conditions are TURE namely while true Represents an infinite loop .
execute statement: Execute statement , That is, what needs to be executed after the cycle conditions are met .2:eval() Function will formula character string Convert to formula
边栏推荐
- 深部位移监测系统wk813应用边坡、大坝、堤防、铁路和建筑基坑开挖等深部位移测量
- js 链表 01
- Open light input / relay output rs485/232 remote data acquisition IO module ibf70
- Redis series 4: sentinel (sentinel mode) with high availability
- 食品安全 | 这两类瓜果宜改善便秘 孕妇人群尤其建议
- What are the process specifications of software testing? How to do it?
- Ffmpeg get the first frame
- Voltage to current / current to voltage module
- js 数组(总结)
- Temperature measurement and imaging accuracy of ifd-x micro infrared imager (module)
猜你喜欢

2021 肯特面试题3

MLX90640 红外热成像仪测温传感器模块开发笔记(八)
![[Multisim Simulation] LM339 zero crossing circuit simulation](/img/ca/f6dae5fd298c00570407c2bdfa5118.png)
[Multisim Simulation] LM339 zero crossing circuit simulation

食品安全 | 这两类瓜果宜改善便秘 孕妇人群尤其建议

IFD-x 微型红外成像仪(模块)的温度测量和成像精度

js 优先级队列

2021 亚鸿笔试题2

Paging query in applet

Laser rangefinder non-contact surface crack monitor

Duty cycle switch output high speed pulse counter rtumodbus module ibf63
随机推荐
Connection and application of portable borehole inclinometer data acquisition instrument and inclinometer probe
STM32F103C8T6 + 0.96“ I2C OLED显示3D_Cube
分体式测斜探头安装要点及注意事项
以太网转RS485串口计数器WiFI模块 LED灯光控制器IBF165
js 数组(总结)
R语言ggplot2可视化绘制线图(line plot)、使用gghighlight包突出高亮线图中满足组合判断条件的线图(satisfies both condition A and B)
2021-10-21 notes
射频模块无线收发RF63U芯片应用数据传输和基建网络
Multifunctional mixed signal AI acquisition / switching value di/do acquisition to rs485/232/modbus module
Shell编程规范与变量
管理区解耦架构见过吗?能帮客户搞定大难题的
R语言使用fs包的file_delete函数删除指定文件夹下的指定文件、举一反三、dir_delete函数、link_delete函数可以用来删除文件夹和超链接
光学雨量计对比翻斗式雨量计的优势
使用py,根据日志记录自动生成周报
js 双向链表 01
Note: numerical accumulation animation
太阳能路灯的根本结构及作业原理
2021 Yahong pen test questions
0-75mv/0-100mv to rs485/232 communication interface Modbus RTU acquisition module ibf8
How to measure the vibrating wire sensor by vibrating wire acquisition module?