Complete the code to calculate the total cost by multiplying unit cost with quantity.
total_cost = unit_cost [1] quantityMultiplying unit cost by quantity gives the total cost.
Complete the code to calculate complexity score by adding number of layers and number of components.
complexity_score = layers [1] componentsAdding layers and components gives a simple complexity score.
Fix the error in the code to calculate cost per complexity unit by dividing total cost by complexity score.
cost_per_complexity = total_cost [1] complexity_scoreDividing total cost by complexity score gives cost per complexity unit.
Fill both blanks to create a dictionary mapping component names to their costs, but only include components costing more than 10.
component_costs = {name: cost for name, cost in components.items() if cost [1] 10 and name [2] 'Resistor'}The code filters components costing more than 10 and excludes resistors by checking name not equal to 'Resistor'.
Fill all three blanks to create a dictionary of components with cost above 5, keys as uppercase names, and values as costs minus 2.
filtered_components = {name[1]: cost[2] 2 for name, cost in components.items() if cost [3] 5}The dictionary comprehension uses name.upper() as keys, subtracts 2 from cost for values, and filters costs greater than 5.
