title: Function not returning value (Python 2.7)
body: <p>I am trying to implement a bisection method function in Python 2.7. I am really stumped as to why my code isn't returning the root that I am bracketing in my test.</p>
  
  <p>When I put print statements in the code, it is clear that the algorithm is finding the root, but I must have missed something basic in the actual syntax (I am a complete newby to python).</p>
  
  <p>Code is here:</p>
  
  <pre><code>def bisection(a,b,fun,tol):
      c = (a+b)/2.0
      if (b-a)/2.0 &lt;= tol:
          #Debugging print statement 1:
          #print 'SOL1: c = ', c
          return c
  
      if fun(c) == 0:
          #Debugging print statement 2:
          #print 'SOL2: c = ', c
          return c
  
      elif fun(a)*fun(c) &lt; 0:
          b = c
      else:
          a = c
      print 'a =', a
      print 'b =', b
      bisection(a, b, fun, tol)
  
  def tstr(x):
      return 2*(x**2) - 3*x + 1
  
  sol = bisection(0, 0.9, tstr, 0.01)
  </code></pre>