python 小甲鱼猜数字游戏
1、
#guess integer game
import random
secret = random.randint(1,10)
temp = input("please input an integer:")
guess = int(temp)
times = 1
while (guess != secret) and (times < 3):
if guess > secret:
print("big,big")
else:
print("small,small")
temp = input("please try again:")
guess = int(temp)
times += 1
if (guess == secret) and (times <= 3):
print("you are right.")
else:
print("three times chance over, game over!")