当前位置:网站首页>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
边栏推荐
- What are the process specifications of software testing? How to do it?
- Remember the common JS methods of projects
- 正大杯黑客马拉松数据解析竞赛
- 记:数值向上取整十,整百,整千,整万
- [Multisim Simulation] LM339 zero crossing circuit simulation
- 远距离串口服务器( 适配器)UART 转 1-Wire 应用
- Use py to automatically generate weekly reports based on log records
- Food safety | these two kinds of melons and fruits should be improved, especially for pregnant women with constipation
- 2021 Yahong pen test questions
- Paging query in applet
猜你喜欢

正大杯黑客马拉松数据解析竞赛

1路编码器2路DI转速测量RS485串口连接1路DO报警模块IBF151

高精度绝对角度传感器应用高速度角度监测

RF module wireless transceiver rf63u chip application data transmission and infrastructure network

Multifunctional mixed signal AI acquisition / switching value di/do acquisition to rs485/232/modbus module

电压转电流/电流转电压模块

js 队列

Paging query in applet

NTC, PT100 thermal resistance to 4-20mA temperature signal converter

JS queue
随机推荐
射频模块无线收发RF63U芯片应用数据传输和基建网络
JS stack
Ffmpeg get the first frame
LabVIEW LINX Toolkit控制Arduino设备(拓展篇—1)
ffmpeg获取首帧
I came across Digital Phoenix coordinate Xuhui Meiluo city in Shanghai
跳表的实现
多功能混合信号AI采集/开关量DI/DO采集转RS485/232/MODBUS模块
12V pulse speed measurement to 24V level signal conversion transmitter
Learn about the native application management platform of rainbow cloud
Note: the value is rounded up to ten, hundred, thousand, ten thousand
MLX90640 红外热成像仪测温传感器模块开发笔记(八)
Zhaoqi science and technology innovation and entrepreneurship competition talent introduction platform, mass entrepreneurship and entrepreneurship competition high-level talent introduction
Remote serial port server (adapter) UART to 1-wire application
带你来浅聊一下!单商户功能模块汇总
2021 Yahong pen test question 2
高速计数器转RS485Modbus RTU模块IBF150
深部位移监测系统wk813应用边坡、大坝、堤防、铁路和建筑基坑开挖等深部位移测量
How to effectively conduct the review meeting (Part 1)?
光学雨量计对比翻斗式雨量计的优势