while True: ten=input("输入分数:") try: score=eval(ten) if type(score)==int: break except: print("请输入数字") pass if score > 100 or score <0: print("分数不合理") elif score >= 80: print("优秀") elif score >= 70: print("良好") elif score >= 60: print("及格") else: print("不及格")