QUESTION 3 Right before checking out at Bath & Body Works, you take a quick inventory of your shopping cart. The number of candles and soaps you've accrued is embarrasing. You decide to put the most expensive item back on the shelf. Given the price of each item in your shopping cart, calculate the total cost of the items, excluding the most expensive item. THIS MUST BE DONE IN ONE LINE Args: price_arr(np.array) Return: float64 >>> price_arr1 = np.array([10.25, 12.5, 5.25, 29.5, 2.5], dtype = "float64") >>> bath_and_body(price_arr1) 30.5 ''' # price_arr1 = np.array([10.25, 12.5, 5.25, 29.5, 2.5], dtype = "float64") # print(bath_and_body(price_arr1)) # price_arr2 = np.array([3.5, 13.35, 5.5, 13.15, 2.5, 2.5], dtype = "float64") # print(bath_and_body(price_arr2))
QUESTION 3
Right before checking out at Bath & Body Works, you take a quick inventory of
your shopping cart. The number of candles and soaps you've accrued is
embarrasing.
You decide to put the most expensive item back on the shelf. Given the
price of each item in your shopping cart, calculate the total cost of the
items,
excluding the most expensive item.
THIS MUST BE DONE IN ONE LINE
Args:
price_arr(np.array)
Return:
float64
>>> price_arr1 = np.array([10.25, 12.5, 5.25, 29.5, 2.5], dtype = "float64")
>>> bath_and_body(price_arr1)
30.5
'''
# price_arr1 = np.array([10.25, 12.5, 5.25, 29.5, 2.5], dtype = "float64")
# print(bath_and_body(price_arr1))
# price_arr2 = np.array([3.5, 13.35, 5.5, 13.15, 2.5, 2.5], dtype = "float64")
# print(bath_and_body(price_arr2))
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images