Python简单的题目,大家都来做一下。
发布网友
发布时间:2022-04-29 20:05
我来回答
共2个回答
热心网友
时间:2022-04-18 08:13
亲,你这个要直到满意为止,就明显不是简单的条件语句能完成的,也不是简单的for循环能解决的,肯定是while语句的啊。。。
num = int(raw_input("Please input your number:"))
while not 0<num<101:
print "Please input a num between 1 and 100!"
num = int(raw_input("Please input your number:"))
else:
print num
热心网友
时间:2022-04-18 09:31
while True:
print "Please input a number:"
a = int(raw_input())
if a>=1 and a<=100:
print "success!"
break
else:
print "number must between 1 and 100"