Complete the code to calculate the total cost by multiplying unit cost and quantity.
total_cost = unit_cost [1] quantityMultiplying unit cost by quantity gives the total cost.
Complete the code to calculate the average cost from a list of costs.
average_cost = sum(costs) [1] len(costs)
Average is total sum divided by number of items.
Fix the error in the code to select the minimum cost from a list.
min_cost = [1](cost_list)max() returns the highest cost, not the lowest.sum() or len() are unrelated.The min() function returns the smallest value in a list.
Fill both blanks to create a dictionary of item costs only if cost is less than 100.
affordable_items = {item: cost for item, cost in items.items() if cost [1] [2]The dictionary comprehension filters items with cost less than 100.
Fill all three blanks to create a dictionary of item names in uppercase with costs greater than 20.
filtered = { [1]: [2] for [3], [2] in data.items() if [2] > 20 }The dictionary comprehension uses uppercase item names as keys and costs as values, filtering costs above 20.
