# Applying a function for several sets of input [duplicate]

I'm trying to understand the Wolfram language and copied some examples from the documentation into a workbook and then tried to work through examples of my own. I'm attempting to evaluate a function with two variables for several combinations of those variables. I've attempted this in the following two ways, but I can only get one output rather than an output for each of the three sets of inputs:

spot = {45, 50, 55};vol = {.20, .30, .40};
Function[{a, b}, FinancialDerivative[{"European", "Call"}, {"StrikePrice" -> 50.00,
"Expiration" -> 1}, {"InterestRate" -> 0.1, "Volatility" -> b,
"CurrentPrice" -> a, "Dividend" -> 0.05}]][spot, vol]


This gives the output 2.42146

I also tried inputting as a pure function:

FinancialDerivative[{"European", "Call"}, {"StrikePrice" -> 50.00,
"Expiration" -> 1}, {"InterestRate" -> 0.1, "Volatility" -> #2,
"CurrentPrice" -> #1, "Dividend" -> 0.05}] &[spot, vol]


and got the same output 2.42146

How can I evaluate the function for spot=45,vol=.2, spot=50,vol=.3 and spot=55,vol=.4?

Add the attribute Listable to your function to make it Thread over the list arguments:

func = Function[{a, b}, FinancialDerivative[{"European", "Call"}, {"StrikePrice" -> 50.00,
"Expiration" -> 1}, {"InterestRate" -> 0.1, "Volatility" -> b,
"CurrentPrice" -> a, "Dividend" -> 0.05}], Listable];

func[spot, vol]


{2.42146, 6.76859, 11.7673}

Alternatively, with a function that is not Listable

func2 = Function[{a, b}, FinancialDerivative[{"European", "Call"}, {"StrikePrice" -> 50.00,
"Expiration" -> 1}, {"InterestRate" -> 0.1, "Volatility" -> b,
"CurrentPrice" -> a, "Dividend" -> 0.05}]];


func2 @@@ Transpose[{spot, vol}]