code(次数限制)
number = 59
guess_flag = False
chance = 3
for i in range(1,chance+1):
print("chance: "+str(i))
guess = int(input("enter an integer: "))
if guess == number:
guess_flag = True
print("bingo you are right")
break
elif guess <number:
print("the number is higher than that "+"and you have only "+str(chance-i)+" times")
else:
print("the number is lower than that "+"and you have only "+str(chance-i)+" times")
print("done")