Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to calculate the total cost by multiplying unit cost and quantity.
Agentic_ai
total_cost = unit_cost [1] quantity Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to calculate the average cost from a list of costs.
Agentic_ai
average_cost = sum(costs) [1] len(costs)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to select the minimum cost from a list.
Agentic_ai
min_cost = [1](costs) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary of costs for items with cost greater than 50.
Agentic_ai
high_cost_items = {item: [1] for item, [2] in costs.items() if [1] > 50} Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to filter and create a dictionary of items with cost less than 100.
Agentic_ai
filtered_costs = { [1]: [2] for [3], cost in costs.items() if cost < 100 } Drag options to blanks, or click blank then click option'
Attempts:
3 left
