Consider this code snippet that uploads a mission to a drone and prints the status. What will it print?
mission = ['takeoff', 'fly_to:10,20,30', 'land'] status = upload_mission(mission) print(status)
Assume the upload_mission function returns "Upload successful" if the mission list is valid and non-empty.
The mission list contains valid commands, so upload_mission returns "Upload successful".
This code executes a mission and prints the result. What is printed?
mission = ['takeoff', 'fly_to:5,5,5', 'hover:10', 'land'] result = execute_mission(mission) print(result)
The execute_mission function completes the mission if all commands are valid.
All commands are valid and the drone completes the mission, so the output is "Mission completed successfully".
What error will this code raise when trying to upload the mission?
mission = ['takeoff', 'fly_to:10,20', 'land'] status = upload_mission(mission) print(status)
The fly_to command expects three coordinates separated by commas.
The command 'fly_to:10,20' has only two coordinates instead of three, causing a ValueError.
Given the mission commands below, which option will cause the drone to pause execution?
mission = ['takeoff', 'fly_to:0,0,10', 'pause', 'land']
Some drones support a 'pause' command to temporarily stop mission execution.
The 'pause' command is designed to pause the mission, so option D is correct.
Analyze the code below. Why does it raise a runtime error during mission execution?
mission = ['takeoff', 'fly_to:10,20,30', 'hover:-5', 'land'] execute_mission(mission)
Hover time must be a positive number.
The 'hover:-5' command tries to hover for negative time, which is invalid and causes a runtime error.