|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
大家看看我这个,为啥输入0~100以外的数字时程序直接结束了?
score= int(input('请输入你的分数:'))
while 0<=score<60:
print('D')
score= int(input('请输入你的分数:'))
while 60<=score<80:
print('C')
score= int(input('请输入你的分数:'))
while 80<=score<90:
print('B')
score= int(input('请输入你的分数:'))
while 90<=score<=100:
print('A')
score= int(input('请输入你的分数:'))
while score<0 or score>100:
score= int(input('请在正确范围内输入你的分数:'))
- score= int(input('请输入你的分数:'))
- while True:
- if 0 <= score <= 100:
- if 0<=score<60:
- print('D')
- elif 60<=score<80:
- print('C')
- elif 80<=score<90:
- print('B')
- elif 90<=score<=100:
- print('A')
- score= int(input('请输入你的分数:'))
- else :
- score= int(input('请在正确范围内输入你的分数:'))
复制代码
|
|