把while True:删掉之后
整个代码往里面缩进
你要将其转换成整形呀,input输入的是字符串,怎么能和数字比较。参考代码如下,有帮助的话采纳一下哦!
score = int(input("输入该学生成绩:"))
if score >= 90 and score <= 100:
print("该学生成绩等级为A")
elif score >= 80 and score <= 90:
print("该学生成绩等级为B")
elif score >= 70 and score <= 80:
print("该学生成绩等级为C")
elif score >= 60 and score <= 70:
print("该学生成绩等级为D")
else:
print("该学生成绩等级为E")
一共就一行,你没事闲的写个循环干啥