import random
secret = random.randint(1,100)
print("-----------猜数字小游戏---------")
temp =input("你不妨猜一下我心里想的是哪个数字")
guess =int(temp)
i =1
while guess != secret:
while i <7:
i = i +1
guess =int(temp)
if guess > secret:
temp =input("小可爱,你猜大了,重新输入吧:")
else:
if guess < secret:
temp =input("小可爱,你猜小了,重新输入吧:")
else:
print("猜中了,奖励你一个么么哒!")
exit()
else:
print("真没默契,不玩咯!")
exit()
代码
网友评论