(Sep-06-2018, 02:09 PM)snippsat Wrote: Basic idea,can use!=
(not equal).
Then loop run until guessed the secret number,so no need to break out of the loop.
import random secret_number = random.randint(1, 100) tries, guess = 0, 0 while guess != secret_number: guess = int(input("Take a guess: ")) # Lower or Higer(if,elif) when secret_number is guess the loop end
Actually, you didn't understand very well:
I don't know if you know the game of the right price, but in any case if you put a lower number than the right number, it should say whether it's smaller or larger.