|  | 
 
| 
uu们,第六讲的动动手第二题:修改上一题的代码,让程序可以不断接收输入,直至用户输入小写字母 e 结束程序
x
马上注册,结交更多好友,享用更多功能^_^您需要 登录 才可以下载或查看,没有账号?立即注册  我想要在打出e的时候顺带写出“继续加油哦!”,不知道我哪里写错了,显示了两遍的“请输入你的分数:”就没有了,求求大佬们解答一下!!
 
 
 """ 请输入成绩 """
 temp=input("请输入你的分数:")
 temp=int(temp)
 while temp !="e":
 
 if temp<60:
 print("D")
 if 60<=temp<80:
 print("C")
 if 80<=temp<90:
 print("B")
 if 90<=temp<100:
 print("A")
 if temp==100:
 print("S")
 temp=input("请输入你的分数:")
 print("继续加油哦!")
 
复制代码temp = ''
while True:
    temp = input("请输入你的分数:")
    if temp != 'e':
        temp = int(temp)
        if temp < 60:
            print("D")
        elif 60 <= temp < 80:
            print("C")
        elif 80 <= temp < 90:
            print("B")
        elif 90 <= temp < 100:
            print("A")
        elif temp == 100:
            print("S")
    else:
        print("继续加油哦!")
        break
 | 
 |