# EXAMPLE_NUM01
# 刚刚的程序,猜一次就结束了,现在想猜三次
# 循环 while 循环
count = 0
while True:
print("count:", count)
count = count + 1
if count == 1000:
break
# EXAMPLE_NUM02
age_of_oldboy = 56
count = 0
while True:
if count == 3:
break
guess_age = int(input("guess age: "))# input 输入默认为 字符串
if guess_age == age_of_oldboy:
print("yes, you got it.")
break
elif guess_age > age_of_oldboy:
print("think smaller...")
else:
print("think bigger!")
count += 1