Python-100-Days/Day01-15/code/Day03/grade.py

26 lines
413 B
Python
Raw Normal View History

2018-03-02 00:09:06 +08:00
"""
百分制成绩转等级制成绩
2019-05-03 21:17:36 +08:00
90分以上 --> A
80~89 --> B
70~79 --> C
60~69 --> D
60分以下 --> E
2018-03-02 00:09:06 +08:00
Version: 0.1
Author: 骆昊
Date: 2018-02-28
"""
score = float(input('请输入成绩: '))
if score >= 90:
2019-05-03 21:17:36 +08:00
grade = 'A'
2018-03-02 00:09:06 +08:00
elif score >= 80:
2019-05-03 21:17:36 +08:00
grade = 'B'
2018-03-02 00:09:06 +08:00
elif score >= 70:
2019-05-03 21:17:36 +08:00
grade = 'C'
2018-03-02 00:09:06 +08:00
elif score >= 60:
2019-05-03 21:17:36 +08:00
grade = 'D'
2018-03-02 00:09:06 +08:00
else:
2019-05-03 21:17:36 +08:00
grade = 'E'
2018-03-02 00:09:06 +08:00
print('对应的等级是:', grade)