为啥报错?设置捕获了呀!
#p3_85.pyimport easygui as eg
try:
成绩 = int(eg.enterbox(msg = '请输入成绩:' , title = '成绩评价系统'))
if 成绩 < 0.25 or 成绩 > 120.25 or 成绩 == None:
成绩 = eg.enterbox(msg = '输入错误!请重新输入成绩:' , title = '成绩评价系统')
elif 成绩 == 120:
eg.msgbox(msg = '评价等级:SSS' , title = '结果' , ok_button = '确定')
elif 成绩 > 115:
eg.msgbox(msg = '评价等级:SS' , title = '结果' , ok_button = '确定')
elif 成绩 > 110:
eg.msgbox(msg = '评价等级:S' , title = '结果' , ok_button = '确定')
elif 成绩 > 95:
eg.msgbox(msg = '评价等级:A+' , title = '结果' , ok_button = '确定')
elif 成绩 > 80:
eg.msgbox(msg = '评价等级:B' , title = '结果' , ok_button = '确定')
elif 成绩 > 75:
eg.msgbox(msg = '评价等级:C-' , title = '结果' , ok_button = '确定')
elif 成绩 < 75:
eg.msgbox(msg = '评价等级:D' , title = '结果' , ok_button = '确定')
except (ValueError , TypeError) as tc:
eg.msgbox(msg = ('出错啦!T_T/n错误原因是:' + tc) , title = '错误' , ok_button = '确定')为啥运行之后不输入报错?
页:
[1]