title: PYTHON - Reverse Number Guessing Game -
body: <p>So I've been trying to figure out a way to write a program where the computer tries to guess the number I am thinking of, instead of the other way around where you are guessing a computer's chosen number. It works most of the time however in some situations it does repeat numbers down the chain even though I've told it before that for example the value I am thinking of is higher than '7'. In some cases it also repeats the same number again even though I tell it its higher or lower. If someone more experienced could have a look at this and tell me what am I missing in these loops it would help a great deal.</p>
  
  <pre><code>#computer enters a value x
  #lower - computer guesses lower than x
  #higher - computer guesses higher than x
  #when string "You got it!" - game over
  
  import random
  
  lowBound = 0
  highBound = 100
  randomNumber = random.randint(lowBound,highBound)
  
  print ("Is it ", randomNumber, " ?")
  response = input()
  
  while response != "You got it!":
      if response == "higher":
          lowBound = randomNumber    
          randomNumber = random.randint (lowBound, highBound)
          print ("Is it ", randomNumber, " ?")
          response = input()
  
      elif response == "lower":
          highBound = randomNumber
          randomNumber = random.randint (lowBound, highBound)
          print ("Is it ", randomNumber, " ?")
          response = input()
  
      if response == "You got it!":
  
          print ("Woohooo, I'm so bitchin'")
  </code></pre>