代码:
#ScoreConvert.py(成绩转换.py)
'''
将学生的百分制成绩转换成等级:score>=90-->优秀,>=80-->良好,
>=70-->中等,>=60-->及格,<60-->不及格
'''
Score=eval(input('请输入一个百分制成绩:'))
if Score>=90 and Score<=100:
print('您的成绩为:优秀')
elif Score >=80 and Score<90:
print('您的成绩为:良好')
elif Score >=70 and Score<80:
print('您的成绩为:中等')
elif Score >=60 and Score<70:
print('您的成绩为:及格')
elif Score <=60 and Score>=0:
print('您的成绩为:不及格')
else:
print('输入成绩不正确')
输出结果: