title: python 'float' object cannot be interpreted as an integer
body: <pre><code>import numpy as np
  def romberg(f,l):
      val=np.zeros(l)
      for i in range(0,l):
          h=2**(1-i)
          N=2/h
          val[i]=trapez(f,h,N)
      return val
  
  def trapez(f,h,N):
      result=0                     
      stuetz=np.zeros(N+1);
      for j in range(0,N+1):
          stuetz[j]=0+j/N                  
      sum=0
      for k in range(1,N):                 #bilde summe von 1-N-1
          sum+=np.polyval(f,stuetz[k])
      a=np.polyval(f,0)*0.5*h
      b=(np.polyval(f,stuetz[N]))*0.5*h
      result=a+(h*sum)+b
      return result
  </code></pre>
  
  <p>main:</p>
  
  <pre><code>p=[1,0,0]
  romberg(p,5)
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>----&gt; 3 romberg(p,5)
  
  ----&gt; 7         val[i]=trapez(f,h,N)
  </code></pre>
  
  <p>TypeError: 'float' object cannot be interpreted as an integer</p>
  
  <p>how can i fix this please help me?
  i appreciate it!</p>