09-08-周一_11-52-21

This commit is contained in:
2025-09-08 11:52:21 +08:00
parent 6f8a7aabee
commit a6e6a4d0c6

View File

@@ -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
基本循环