Challenge - 5 Problems
Simulation Safety Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of a simple drone simulation loop
What is the output of this drone simulation code snippet that runs a safety check loop?
Drone Programming
for i in range(3): if i == 2: print('Crash detected! Simulation stopped.') break else: print(f'Step {i}: All systems normal.')
Attempts:
2 left
💡 Hint
Look at the loop and the break statement when i equals 2.
✗ Incorrect
The loop prints normal status for i=0 and i=1. When i=2, it detects a crash and stops the simulation with a break.
🧠 Conceptual
intermediate1:30remaining
Why use simulation before real drone flights?
Which of the following is the main reason simulation helps prevent costly crashes in drone programming?
Attempts:
2 left
💡 Hint
Think about what happens if you test risky code on a real drone.
✗ Incorrect
Simulation lets programmers try out code and detect errors safely, avoiding damage to expensive drones.
🔧 Debug
advanced2:00remaining
Identify the error in this simulation code snippet
What error will this drone simulation code produce when run?
Drone Programming
def simulate_flight(steps): for step in range(steps): if step == 5: print('Emergency stop!') break print(f'Flying step {step}') simulate_flight(10)
Attempts:
2 left
💡 Hint
Check the if condition syntax carefully.
✗ Incorrect
The if condition uses '=' which is assignment, not '==' for comparison, causing a SyntaxError.
❓ Predict Output
advanced1:30remaining
Output of drone sensor data filtering simulation
What is the output of this code that filters sensor readings above a threshold during simulation?
Drone Programming
sensor_readings = [12, 5, 18, 7, 20] filtered = [r for r in sensor_readings if r > 10] print(filtered)
Attempts:
2 left
💡 Hint
Look for readings greater than 10.
✗ Incorrect
Only readings 12, 18, and 20 are greater than 10, so they appear in the filtered list.
🧠 Conceptual
expert2:00remaining
Why simulation reduces overall drone project costs
Which statement best explains how simulation reduces costs in drone projects?
Attempts:
2 left
💡 Hint
Think about the cost of fixing problems after a crash versus before.
✗ Incorrect
By finding bugs early in simulation, developers avoid crashes that can damage drones and increase costs.