import random
def guess_zodiac_game():
zodiacs = [‘鼠’, ‘牛’, ‘虎’, ‘兔’, ‘龙’, ‘蛇’, ‘马’, ‘羊’, ‘猴’, ‘鸡’, ‘狗’, ‘猪’]
g = 1
while g:
print(“请输入 12 生肖的其中一个”)
user_guess = input()
number = 0
while True:
random_zodiac = random.choice(zodiacs)
number += 1
if random_zodiac < user_guess:
print(“Guess big 猜大了!”)
elif random_zodiac > user_guess:
print(“Guess it’s too small 猜小了!”)
else:
print(f"Guess right 猜对了!\nThe number of guesses is 猜测次数是:{number}")
break
g = int(input(“Wanna continue 想继续吗? 1.continue 继续 0.exit 退出\n”))
if name == “main”:
guess_zodiac_game()