Question: Write one function without using a dictionary in python 3. ASAP please! Function name: total_cost Parameters: list, boolean Return value: list Description: After you come
Function name: total_cost Parameters: list, boolean Return value: list Description: After you come back from vacation, you want to figure out how much you spent per item. Write a function that takes in a list of strings in the format "item $0.0" and a boolean. If the boolean is True, you want to return a list containing the float of the total cost of all the items in the list. If the boolean is False, you want to return a list of lists, where each list contains the item name and the total price for that item. If an item appears more than once in your list, you should add the prices together. If an empty list is passed in, return an empty list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
