A
A
Alya2017-09-09 13:16:16
Python
Alya, 2017-09-09 13:16:16

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

i'm just learning :
array and f are lists

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Astrohas, 2017-09-09
@Astrohas

def lagr(*arrays):
-
lagr(array_1, array_2, massive_3)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question