from random import randint
num = randint(1,100)
print('你猜我心里想的数字是几呢?')
bingo = False
while bingo == False:
anwser = int(input('请输入:'))
if anwser < num:
print('你猜的太小了!')
if anwser > num:
print('你猜的太大了!')
if anwser == num:
print('你猜对了!!!')
bingo = True
转载请注明:八度生活 » python学习 猜数字小游戏