title: Syntax error when trying to pass a value from one variable to another
body: <p>I'm currently trying to write a root finder using secant method. I just did the same thing with Newton Raphson method, and have not been getting this error. It comes when I say xold=xnow when trying to reassign the values for each iteration. It doesn't give me any information other than 'syntax error', and I used this exact method for Newton's with no issues. What gives?</p>
  
  <pre><code>def secant(n):
      def function(x):
          f=x-math.cos(x)
      return f
  
      xold=0.0
      xnow=1.0
  
      for i in range(n):
          xnew=xnow-function(xnow)((xnow-xold)/(function(xnow)-function(xold))
          xold=xnow
          xnow=xnew
      return xnew
  
  def main():
      print("The root is",secant(10))
  
  return
  </code></pre>