title: Assigning the last iterated value to a variable in python
body: <p>I have the last set of values of an iteration: <code>y1[i],y2[i],y3[i]</code>(which was obtained by doing the integration of coupled ODE)
  Now I need to assign these values to another variables : Y1,Y2,Y3 and then use these variables in a function f(y,t) (ODEs that has to be integrated again).
  This is part of my code:</p>
  
  <pre><code>#constants used
  H = 2.27e-18
  l = 1.5
  G = 6.637*(10**(-11))
  k = (8*3.14*G)**0.5
  om_de = 0.75
  omega_matter = 1 - om_de
  w0 = -0.85
  rho_c = 3*(H**2)/(k**2)
  c = ((om_de*(1 + w0)*rho_c)/(H**2))**0.5
  v0 = (om_de*(1 - w0)*rho_c)/(2*np.exp(-l*k))
  
  #for iteration
  p = 0.0
  q = 1.0
  n = 10000.0
  
  def H(Y1,Y2,Y3):
      return -3*Y3*(H**2)*(omega_matter/(Y1**3) + (H**2)*(Y3**2)/(2.0*rho_c) + (v0*np.exp(-l*Y2*k))/(rho_c))**0.5 + (l*k*v0*np.exp(-l*Y2*k))/(H**2)
  
  dH = (q-p)/n
  Y1 = [y1[j]]
  Y2 = [y2[j]]
  Y3 = [y3[j]]
  But I am not able to do any further operations on them.
  </code></pre>
  
  <blockquote>
    <p>TypeError: unsupported operand type(s) for ** or pow(): 'function' and
    'int'</p>
  </blockquote>
  
  <p>keeps showing up.
  The link to the complete code is here:
  <a href="https://pastebin.com/mdQE29N9" rel="nofollow noreferrer">https://pastebin.com/mdQE29N9</a> (might help in understanding what I am trying to achieve and the code is too lengthy to be posted here)</p>
  
  <p>I think the problem is with the way I have assigned the values,but am not so sure. Any help here as to what is causing this and how I am supposed to solve this would be great.</p>