Question

What will this line of code do?

numpy.sum(item_prices)

(1 point)
Responses

create a variable called item_prices to hold the sum

create a variable called item_prices to hold the sum

add together the values in an array called item_prices

add together the values in an array called item_prices

add the variable sum to the array called item_prices

add the variable sum to the array called item_prices

add the variable item_prices to the sum

add the variable item_prices to the sum
Skip to navigation

1 answer

The correct response is:

add together the values in an array called item_prices

The line of code numpy.sum(item_prices) calculates the sum of all the elements in the array item_prices.