|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
score = int(input())
while score <= 100:
if 100 >= score >= 90:
print('great')
elif 90 > score >= 85:
print('good')
elif 85 > score >= 60:
print('well')
elif 60> score >= 0:
print('come on')
else:
print('false')
temp = input('go on')
按照小甲鱼《零基础入门学习python》p4_3.py,例子,只能运行一次,如果想要循环运行,自己想了一个命令,可以循环,但出现了第一次结果正确,后续无论输入多少数值,都显示第一次运行的结果,如下面:
= RESTART: C:\Users\admin\AppData\Local\Programs\Python\Python38\3.101可循环但不显示正确结果.py
30
come on
go on60
come on
go on100
come on
go on95
come on
go on
求大神解惑
改成这样:
- score = 0
- while score <= 100:
- score = int(input('go on'))
- if 100 >= score >= 90:
- print('great')
- continue
- elif 90 > score >= 85:
- print('good')
- continue
- elif 85 > score >= 60:
- print('well')
- continue
- elif 60> score >= 0:
- print('come on')
- continue
- else:
- print('false')
- continue
-
- continue
复制代码
|
|