Answer the question
In order to leave comments, you need to log in
How to pass multiple lists to a function?
How to pass multiple lists to a function?
def lagr(k, mx, my):
i=0
j=0
Lagrange=0
while i<n:
numerator=1
denominator=1
while j<n:
if(i!=j):
numerator=numerator*(k-mx[j])
denumerator=denumerator*(mx[i]-mx[j])
j+=1
Lagrange=Lagrange+my[i]*numerator/denumerator
i+=1
return Lagrange
........
while i<m:
L.insert(i,lagr(array[i],array,f))
i+=1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question