首页 > 代码库 > 猜年龄,三次失败退程序

猜年龄,三次失败退程序

my_age = 30

count = 0
while count < 3:
    user_input = int(input("input your guess number:"))
    if user_input == my_age:
        print("good job,you got it!")
        break
    elif user_input > my_age:
        print("no no no try samller")
    else:
        print("no no no try bigger")
    count += 1
else:
    print("对你无语,拜拜!")

  

猜年龄,三次失败退程序