Complete the code to set the MQTT message QoS level to 1.
client.publish(topic, message, qos=[1])QoS level 1 means the message is delivered at least once, ensuring delivery but possibly duplicates.
Complete the code to set the MQTT client to receive messages with QoS level 2.
client.subscribe(topic, qos=[1])QoS level 2 ensures exactly once delivery, the highest guarantee in MQTT.
Fix the error in the QoS level assignment to ensure valid MQTT QoS.
qos_level = [1]Valid MQTT QoS levels are 0, 1, or 2. 1 is a valid choice.
Fill both blanks to create a dictionary mapping QoS levels to their descriptions.
qos_descriptions = {0: '[1]', 2: '[2]'}QoS 0 means at most once delivery (no guarantee), QoS 2 means exactly once delivery.
Fill all three blanks to create a dictionary comprehension filtering QoS levels greater than 0.
filtered_qos = {level: desc for level, desc in qos_descriptions.items() if level [1] [2] and desc != '[3]'}This comprehension keeps QoS levels greater than 0 and excludes 'At most once delivery'.