第一种方法
score = float(input('请输入你的分数'))
if score < 0 or score > 100:
print('请输入一个1-100直接的分数')
score = float(input('请输入你的分数'))
else:
if score < 60:
print('不及格')
elif score < 80:
print('及格')
elif score < 90:
print('良好')
elif score < 100:
print('优秀')
第二种方法
score = int(input('请输入你的分数:'))
degree = 'ABCDE'
num = 0
if score < 0 or score > 100:
print('请输入一个1-100直接的分数')
score = float(input('请输入你的分数'))
else:
num = score // 10
if num < 6:
num = 5
print(degree[9-num])