How to automate table's values use as arg in a function?

Viewed 13

I have a function with two args: Function (A, B):...

In my function, arg must be paired and are actually registered within a table as shown:

A B
Arg A1 Arg B1
Arg A2 Arg B2

Is there a way to read the function with every line from the table without writing manually function(Arg A1, Arg B1), function(Arg A2,Arg B2 ) etc... ?

Where:

1 Answers

Try the following:

for (a,b) in zip(A,B):
   result = function(a,b)
   print(result)

This requires however that you have Aand Bas a list.

Related