title: While loop with else
body: <p>I am working with a while loop which I am trying to run for 5 minutes and check if it gets the http response code 200. The problem is if it doesn't get 200 it will be keep running, but it doesn't go to the else when the site should be up and running. </p>
  
  <pre><code>r = requests.head("http://www.testing.co.uk")
  while r.status_code != 200:
      print "Response not == to 200."
      time.sleep(30)
  else:
      print "Response is 200 - OK"
  </code></pre>