Python-100-Days/Day03/grade.py

28 lines
405 B
Python
Raw Normal View History

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