Python 成绩等级判定

score=int(input("请输入学生成绩:"))
if 90<=score<=100:
    grade="A"
elif 75<=score<=90:
    grade="B"
elif 60<=score<=75:
    grade="C"
elif score<60:
    grade="D"
print("本次考试,等级为:",grade)

Python 成绩等级判定_第1张图片

运行结果:

383e46c0cbdb4d7c83455ac644353e99.png 

 

 

你可能感兴趣的:(python,笔记)