入门猜数字游戏哪里错了呢?tries=tries+1没用上!

importrandomsecret=random.randint(1,100)guess=0tries=0
print("AHOY!I'mthedreadPirateroberts,andIhaveasecret!")print("Itisanumberfrom1to99.I'llgiveyou6tries.")
whileguess!=secretandtries<6:
guess=int(input("what'syerguess?"))
ifguessprint("toolow")
elifguess>secret:
print("toohigh")
tries=tries+1
ifguess==secret:
print("down!")
else:
print("nomore")
print("thesecretwas",secret)
小唯快跑啊
浏览 402回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript