Jul-24-2017, 03:19 PM
So I chose the second solution to get rid of new_max and new_min. However, I don't really know after a low guess, I have minimum=guess, but how about the maximum in this case (I guess I'll keep the previous max but I don't know what to assign for max), and and vice versa for the high guess.
This is what I have now, thanks a lot!
This is what I have now, thanks a lot!
import random random.randint(1,99) answer = int(input()) print("1<?<100") while True: guess = int(input()) if guess ==answer: print("bingo answer is",answer) break elif guess<answer: print("wrong answer, guess larger") minimum=guess print(minimum,"<?<",maximum) elif answer<guess: maximum=guess print("wrong answer, guess smaller") print(minimum,"<?<",maximum)