想写能持续输入分数的程序,但当打印是‘输入错误’时,程序就停止了,求支招!
secret = int(input('输入分数:'))while 0 <= secret <=100:
if90 <= secret <=100:
print('A')
elif 80 <=secret <90:
print('B')
elif 70 <=secret <80:
print('C')
elif 0 <=secret <70:
print('D')
secret = int(input('输入分数:'))
else:
print('输入错误')
secret = int(input('输入分数:'))
count = 5
while count > 0:
secret = int(input('输入分数:'))
count -= 1
if 90<= secret <= 100:
print('A')
elif 80<= secret < 90:
print('B')
elif 70 <= secret < 80:
print('C')
elif 60<= secret < 70:
print('D')
elif secret < 60:
print('E')
elif secret > 100:
print('输入错误')
页:
[1]