应该是缩进问题哦
我用了楼主的代码执行没有问题。
代码格式:
[Python] 纯文本查看 复制代码 num = 10
bingo = False
print('guess what number?')
while bingo ==False:
answer = int(input('Plz put a number: '))
if answer > num:
print('It\'s too big')
elif answer < num:
print('It\'s too small')
elif answer == num:
print('Bingo!')
bingo = True
纯文本:
num = 10
bingo = False
print('guess what number?')
while bingo ==False:
answer = int(input('Plz put a number: '))
if answer > num:
print('It\'s too big')
elif answer < num:
print('It\'s too small')
elif answer == num:
print('Bingo!')
bingo = True
|