怎样写python脚本
展开全部
index=True
while index:
score=input("请输入学生成绩(1-100,输入q退出程序):")
try:
if str(score)=="q":
index=False
else:
if int(score)>90 and int(score)<=100:
print "A"
elif int(score)>80 and int(score)<=90:
print "B"
elif int(score)>70 and int(score)<=80:
print "C"
elif int(score)>=60 and int(score)<=70:
print "D"
elif int(score)<60 :
print "E"
else:
print "请输入正确的成绩!"
except:
print "请输入正确的标识符!"
while index:
score=input("请输入学生成绩(1-100,输入q退出程序):")
try:
if str(score)=="q":
index=False
else:
if int(score)>90 and int(score)<=100:
print "A"
elif int(score)>80 and int(score)<=90:
print "B"
elif int(score)>70 and int(score)<=80:
print "C"
elif int(score)>=60 and int(score)<=70:
print "D"
elif int(score)<60 :
print "E"
else:
print "请输入正确的成绩!"
except:
print "请输入正确的标识符!"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |