我用python3.4写的猜数字游戏运行出错。
number=20jieguo=Falsewhilejieguo==False:guess=int(input('Enteranumber'))ifnumber==jie...
number =20
jieguo = False
while jieguo == False:
guess = int(input('Enter a number'))
if number == jieguo:
jieguo = False
elif number > guess:
print("xiaole")
else:
print("dale")
print('Done') 展开
jieguo = False
while jieguo == False:
guess = int(input('Enter a number'))
if number == jieguo:
jieguo = False
elif number > guess:
print("xiaole")
else:
print("dale")
print('Done') 展开
展开全部
number =20
jieguo = False
while jieguo == False:
guess = int(input('Enter a number'))
if number == guess:
jieguo = False
elif number > guess:
print("xiaole")
else:
print("dale")
print('Done')
我没有跑,应该就是错了一处
追问
我想知道是哪里错了。我已经看了好久了,也没看出来哪里有BUG
追答
第六行:
if number == guess:
原来的是:
if number == jieguo:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询