Challenge - 5 Problems
Gimbal Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Gimbal pitch angle adjustment output
What is the output of this code controlling the gimbal pitch angle?
Drone Programming
gimbal_pitch = 10 command = 'up' if command == 'up': gimbal_pitch += 5 elif command == 'down': gimbal_pitch -= 5 print(gimbal_pitch)
Attempts:
2 left
💡 Hint
Check how the pitch angle changes when the command is 'up'.
✗ Incorrect
The initial pitch is 10. The command 'up' adds 5, so the final pitch is 15.
🧠 Conceptual
intermediate1:30remaining
Understanding gimbal stabilization purpose
Why do camera gimbals stabilize the camera during drone flight?
Attempts:
2 left
💡 Hint
Think about what happens to a camera when the drone moves suddenly.
✗ Incorrect
Gimbals keep the camera steady so videos and photos are smooth and not shaky.
🔧 Debug
advanced2:30remaining
Fix the gimbal yaw control error
What error does this code produce when trying to set the gimbal yaw angle?
Drone Programming
gimbal_yaw = 0 def set_yaw(angle): if angle >= -90 and angle <= 90: gimbal_yaw = angle set_yaw(45) print(gimbal_yaw)
Attempts:
2 left
💡 Hint
Check the if statement syntax carefully.
✗ Incorrect
The if statement is missing a colon at the end, causing a SyntaxError.
📝 Syntax
advanced2:30remaining
Identify the correct gimbal pitch control syntax
Which option correctly sets the gimbal pitch to 30 degrees using a function?
Attempts:
2 left
💡 Hint
Consider variable scope inside and outside the function.
✗ Incorrect
Option C uses 'global' to modify the pitch variable outside the function, so print(pitch) works.
🚀 Application
expert3:00remaining
Calculate final gimbal roll angle after commands
Given the initial roll angle is 0, and the commands ['left', 'left', 'right', 'left'] change the roll by -10, -10, +10, -10 degrees respectively, what is the final roll angle?
Attempts:
2 left
💡 Hint
Add each command's effect step by step starting from 0.
✗ Incorrect
Starting at 0: left(-10) → -10, left(-10) → -20, right(+10) → -10, left(-10) → -20 final.