成绩判断

1.编写程序实现输入成绩,判断是否通过考试。


a=int(input("输入成绩:"))
if a>60:
    print("成绩通过考试!")
else :
    print("成绩未通过考试!")

2.编写程序实现根据考试成绩将成绩分为A,B,C,D四档。


a=int(input("输入考试成绩:"))
if a>=90 and a<100:
    print("成绩等级为A!")
elif a>=80 and a<90:
    print("成绩等级为B!")
elif a>=60 and a<80:
    print("成绩等级为C!")
else:
    print("成绩等级为D!")

猜你喜欢

转载自blog.csdn.net/qq_45976312/article/details/113008471