09-08-周一_11-52-21
This commit is contained in:
@@ -563,6 +563,31 @@ else:
|
|||||||
上面所有的条件不满足就走这段
|
上面所有的条件不满足就走这段
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- 判断分数和对应的评价
|
||||||
|
|
||||||
|
```python
|
||||||
|
score = input("你考了多少分(满分100):")
|
||||||
|
# 判断输入的内容全部是数字组成
|
||||||
|
if score.isdigit():
|
||||||
|
# 转换数据类型,将score转换为整数型
|
||||||
|
score = int(score)
|
||||||
|
if score <= 100 and score >= 0:
|
||||||
|
if score >= 90:
|
||||||
|
print("优秀")
|
||||||
|
elif score >= 80:
|
||||||
|
print("良好")
|
||||||
|
elif score >= 60:
|
||||||
|
print("及格")
|
||||||
|
else:
|
||||||
|
print("不及格")
|
||||||
|
else:
|
||||||
|
print("你输入的数字不对!")
|
||||||
|
else:
|
||||||
|
print("请输入分数")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 流程控制之 --while
|
## 流程控制之 --while
|
||||||
|
|
||||||
基本循环
|
基本循环
|
||||||
|
Reference in New Issue
Block a user