score=float(input("请输入你的成绩。u)
#处理数据
要使成绩高于100及低于0不会出现输出错误
添加score<=100和score>=0确保确保输出正确
if score>=90 and score<=100:
print("您的成绩为优秀"
elif score>=80 and score<=100:
print("您的成绩为良好"
elif score>=70 and score<=100:
print("您的成绩为中等"
elif score>=60 and score<=100:
print("您的成绩为及格"
elif score<60 and score>=0:
print("您的成绩为不及格")
else:
print("您输入错误")
成绩转换phython
最新推荐文章于 2024-07-12 16:16:27 发布