Complete the code to read the sensor value.
sensor_value = sensor.[1]()The read() method gets the current value from the sensor, which is essential for situational awareness.
Complete the code to check if the sensor detects an obstacle.
if sensor.[1]() < 10: alert('Obstacle nearby!')
The get_distance() method returns the distance to the nearest object, which helps the drone avoid collisions.
Fix the error in the code to update sensor data correctly.
sensor_data = sensor.[1]The update() method must be called with parentheses to execute and get fresh sensor data.
Fill both blanks to create a dictionary of sensor readings above a threshold.
important_readings = {sensor.[1](): sensor.[2]() for _ in range(5) if sensor.[1]() > 50}This code collects temperature and humidity readings from the sensor when the temperature is above 50.
Fill all three blanks to filter sensor data and create a summary dictionary.
summary = {sensor.[1](): sensor.[2]() for _ in range(10) if sensor.[3]() < 20}This code collects light and temperature readings only when the distance detected is less than 20.