1. 循环次数限制
lucky_num = 19
guess_count = 0
while guess_count<3:
print("guess count:",guess_count)
input_num = int(input("Input the guess num:"))
if input_num>lucky_num:
print("the real number is smaller.")
elif input_num<lucky_num:
print("the real num is bigger...")
else:
print("Bingo!")
break













来源:https://www.cnblogs.com/fjhf084/p/12313104.html