python,while循环写的猜年龄小程序

origin_age = 66
while 1:
  guess_age = int(input("input guess age:"))
  if guess_age == origin_age:
    print("Congratulations!you are right")
    break
  elif guess_age < origin_age:
    print("please input a bigger age")
  else:
    print("please input a smaller age")

posted @ 2019-11-12 20:20  Iceberg_710815  阅读(209)  评论(0编辑  收藏  举报