猜年齡游戲 Huang_age = 20 a = 0 while True: if a <=2: user_guess = int(input("your guess:\n")) if user_guess == Huang_age: print("恭喜你猜對了!") break elif user ...
猜年齡游戲
Huang_age = 20
a = 0
while True:
if a <=2:
user_guess = int(input("your guess:\n"))
if user_guess == Huang_age:
print("恭喜你猜對了!")
break
elif user_guess < Huang_age:
print("你猜小了!")
a +=1
else:
print("你猜大了!")
a +=1
else:
break