首页 > 代码库 > 找一个幸运数

找一个幸运数

lucky_num =20
input_num=6
guess_count=1
while input_num != lucky_num and guess_count <=3:
print("guess count: %d"%guess_count)
input_num= input("input the guess num:")
if(input_num>lucky_num):
print("the guess num is bigger...")
elif(input_num<lucky_num):
print("thr guess num is smaller...")
guess_count =guess_count + 1
else:
print("Bingo!")
break
else:
print("too many reatrys....")

找一个幸运数