Challenge - 5 Problems
Situational Awareness Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Sensor Data Interpretation Output
What is the output of this code that simulates sensor data readings for obstacle distance and drone speed?
Drone Programming
def sensor_readings(): distance = 15 # meters speed = 5 # m/s if distance < 10: status = 'Obstacle too close' elif speed > 10: status = 'Speed too high' else: status = 'All clear' return status print(sensor_readings())
Attempts:
2 left
💡 Hint
Check the conditions for distance and speed in the code.
✗ Incorrect
The distance is 15 which is not less than 10, and speed is 5 which is not greater than 10, so the else block runs returning 'All clear'.
🧠 Conceptual
intermediate1:30remaining
Why Sensors Are Critical for Situational Awareness
Which of the following best explains why sensors provide situational awareness for drones?
Attempts:
2 left
💡 Hint
Think about what situational awareness means in real life.
✗ Incorrect
Situational awareness means knowing what is happening around you. Sensors provide real-time data so the drone can understand and react to its environment.
🔧 Debug
advanced2:00remaining
Identify the Error in Sensor Data Processing
What error does this code raise when processing sensor data?
Drone Programming
sensor_values = {'distance': 20, 'speed': 8}
if sensor_values['distance'] < 15:
alert = 'Too close'
elif sensor_values['speed'] > 10:
alert = 'Speeding'
else:
alert = 'Safe'
print(alert)Attempts:
2 left
💡 Hint
Check the syntax of the if-elif statements carefully.
✗ Incorrect
The elif line is missing a colon at the end, causing a SyntaxError.
❓ Predict Output
advanced2:00remaining
Output of Sensor Fusion Algorithm
What is the output of this code that fuses two sensor readings to decide drone action?
Drone Programming
def fuse_sensors(distance, light): if distance < 10 and light < 50: return 'Hover' elif distance >= 10 and light >= 50: return 'Move Forward' else: return 'Caution' print(fuse_sensors(8, 60))
Attempts:
2 left
💡 Hint
Check both conditions carefully for distance and light.
✗ Incorrect
Distance is 8 (less than 10) but light is 60 (not less than 50), so neither first nor second condition matches, so else returns 'Caution'.
🚀 Application
expert2:30remaining
Number of Sensor Alerts Generated
Given this code that processes a list of sensor distances, how many alerts will be generated for distances less than 5 meters?
Drone Programming
distances = [3, 7, 2, 10, 4, 6] alerts = [d for d in distances if d < 5] print(len(alerts))
Attempts:
2 left
💡 Hint
Count how many numbers in the list are less than 5.
✗ Incorrect
The distances less than 5 are 3, 2, and 4, so 3 alerts are generated.