title: Python guessing game, counting number of guesses
body: <p>My Intro to Computer Science teacher gave us a dice guessing game challenge, and while I've managed to figure out most of the components, the final piece is to return what the correct number is (once they've guessed it) and the number of tries it took for them to figure it out. My code returns all of that, but it doesn't account for if the person guessing guesses the same number twice. Is there a way to tell them how many guesses it took for them to find a number while disregarding any repeated numbers?</p>
  
  <p>This is the code that I have so far:</p>
  
  <pre><code>import random
  
  give_number = input("We will roll a 6 sided dice. What do you think the number will be?\n ")
  guess_number = 1
  
  dice = random.randint(1,6)
  while give_number != dice:
      if give_number &gt; dice:
          give_number = input("Sorry, that answer is too high! Try again!\n ")
          guess_number = guess_number +1
      if give_number &lt; dice:
          give_number = input("Sorry, that answer is too low! Try again!\n ")
          guess_number = guess_number +1
  
  print "Congratulations, you were right, the answer was {}! It took you {} tries.".format(dice, guess_number)
  </code></pre>