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

26 lines
433 B
Python
Raw Permalink Normal View History

2018-03-02 00:09:06 +08:00
"""
百分制成绩转等级制成绩
2019-06-12 01:23:30 +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)