Complete the code to show the HTTP method used for request-response communication.
http_method = "[1]"
The GET method is commonly used in HTTP for request-response communication, where a client requests data from a server.
Complete the code to define the HTTP status code for a successful response.
status_code = [1]HTTP status code 200 means the request was successful and the server returned the requested data.
Fix the error in the HTTP request line to correctly specify the method.
request_line = "[1] /sensor/data HTTP/1.1"
The HTTP request line must start with a valid method like GET to request data from the server.
Fill both blanks to create a dictionary comprehension that maps sensor IDs to their status if status is 'active'.
active_sensors = {sensor_id: [1] for sensor_id, [2] in sensors.items() if status == 'active'}The comprehension maps sensor_id to status, and unpacks sensor_id and status from the items.
Fill all three blanks to create a dictionary comprehension that maps sensor IDs to their readings if reading is above 50.
filtered_readings = [1]([2]: [3] for [2], reading in readings.items() if reading > 50)
The comprehension creates a dictionary mapping sensor_id to reading, filtering readings above 50.