Challenge - 5 Problems
Drone Arming Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of arming sequence with safety check
What is the output of this drone arming code snippet when the safety switch is off?
Drone Programming
safety_switch = False armed = False if safety_switch: armed = True print('Armed' if armed else 'Disarmed')
Attempts:
2 left
💡 Hint
Check the condition that sets the armed state.
✗ Incorrect
The safety switch is off (False), so the condition to arm the drone is not met. The drone remains disarmed.
🧠 Conceptual
intermediateUnderstanding disarming conditions
Which condition below correctly disarms the drone in a typical sequence?
Attempts:
2 left
💡 Hint
Think about what safety-critical conditions require disarming.
✗ Incorrect
Low battery is a critical safety condition that requires immediate disarming to prevent crash or damage.
🔧 Debug
advancedIdentify the error in the arming code
What error does this code produce when run?
armed = False
safety_switch = True
if safety_switch = True:
armed = True
print('Armed' if armed else 'Disarmed')
Attempts:
2 left
💡 Hint
Check the if statement syntax carefully.
✗ Incorrect
The if statement uses '=' instead of '==', causing a syntax error.
🚀 Application
advancedNumber of steps in a safe arming sequence
How many distinct steps are typically required to safely arm a drone?
Attempts:
2 left
💡 Hint
Consider all safety checks before arming.
✗ Incorrect
A safe arming sequence includes multiple checks: safety switch, throttle position, GPS lock, and battery level.
❓ Predict Output
expertOutput of complex arming/disarming logic
What is the output of this code?
status = 'disarmed'
safety_switch = True
throttle = 0
battery = 15
GPS_lock = True
if safety_switch and throttle == 0 and battery > 20 and GPS_lock:
status = 'armed'
elif battery <= 20:
status = 'disarmed due to low battery'
else:
status = 'disarmed'
print(status)
Drone Programming
status = 'disarmed' safety_switch = True throttle = 0 battery = 15 GPS_lock = True if safety_switch and throttle == 0 and battery > 20 and GPS_lock: status = 'armed' elif battery <= 20: status = 'disarmed due to low battery' else: status = 'disarmed' print(status)
Attempts:
2 left
💡 Hint
Check the battery condition and order of conditions.
✗ Incorrect
Battery is 15 which is <= 20, so the elif condition triggers and sets status to 'disarmed due to low battery'.
