Complete the code to select the protocol with the highest data rate.
best_protocol = max(protocols, key=lambda p: p['[1]'])
We use 'data_rate' to find the protocol with the highest speed.
Complete the code to filter protocols with low power consumption.
low_power_protocols = [p for p in protocols if p['power_consumption'] [1] 50]
We want protocols with power consumption less than or equal to 50 units.
Fix the error in the code to correctly calculate average latency.
average_latency = sum(p['latency'] for p in protocols) [1] len(protocols)
Average is total latency divided by number of protocols.
Fill both blanks to create a dictionary of protocols with latency less than 100ms.
fast_protocols = {p['[1]']: p['[2]'] for p in protocols if p['latency'] < 100}Keys are protocol names and values are their data rates.
Fill all three blanks to create a filtered dictionary of protocols with range over 100m and power consumption under 60.
selected_protocols = {p['[1]']: p['[2]'] for p in protocols if p['range'] [3] 100 and p['power_consumption'] < 60}We select protocols by name as keys, data rate as values, and filter by range greater than 100 meters.
