title: Finding square root without using math.sqrt()?
body: <p>I recently was working on finding the square root of a number in <code>python</code> without using <code>sqrt()</code>. I came across this code and am having difficulty in understanding the logic in this code:</p>
  
  <pre><code>def sqrt(x):
      last_guess= x/2.0
      while True:
          guess= (last_guess + x/last_guess)/2
          if abs(guess - last_guess) &lt; .000001: # example threshold
              return guess
          last_guess= guess
  </code></pre>
  
  <p>More specifically the logic behind calculating <code>guess</code> in above code. Can anyone help me understanding the logic?</p>