title: Python example repeating answer during quiz and not at end
body: <p>and I apologies for the simple nature of my question.</p>
  
  <p>Im working my way through "Hello World", Computer programming for Kids and Beginners - By Warren and Carter Sande.</p>
  
  <p>The first chapters second example is this numeric example, of a pirate number quiz. Programming language is Python.</p>
  
  <p>Its supposed to allow 6 guesses, unless the correct number is guessed first. I guess for you people the code would be self explanatory.</p>
  
  <pre><code>import random
  
  secret = random.randint(1,99)
  guess = 0
  tries = 0
  
  print "AHOY! I'm the dread Pirate Roberts, and I have a secret!"
  print "It's a number from 1 to 99. I'll give you 6 tries."
  
  while guess != secret and tries &lt; 6:
  guess = input("What's yer guess? ")
  if guess &lt; secret:
      print "Too low, ye scurvy dog!"
  elif guess &gt; secret:
      print "Too high, landlubber!"
  tries = tries +1
  if guess == secret:
      print "Avast! Ye got it! Found my secret, ye did!"
  else:
      print "No more guesses! Better luck next time, matey!"
      print "The secret number was", secret
  </code></pre>
  
  <p>But when I run it, it tells me what the answer is after each guess, which its not supposed to. Its supposed to wait until the end.</p>
  
  <p>I just cant figure out what I have done wrong. I have checked each line, or at least, I think I have. </p>
  
  <p>If someone could point out where I have gone wrong, that would be great.</p>