0
0
Drone Programmingprogramming~20 mins

Multi-drone coordination concept in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Multi-Drone Coordination Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of drone position update loop
Consider a fleet of drones updating their positions in a loop. What is the output of the following code snippet?
Drone Programming
drones = [{'id': 1, 'pos': 0}, {'id': 2, 'pos': 5}]
for drone in drones:
    drone['pos'] += 3
print([d['pos'] for d in drones])
A[3, 8]
B[0, 5]
C[1, 6]
D[6, 11]
Attempts:
2 left
💡 Hint
Each drone's position increases by 3.
🧠 Conceptual
intermediate
1:30remaining
Understanding drone collision avoidance logic
In multi-drone coordination, what is the main purpose of a collision avoidance algorithm?
ATo reduce battery consumption by turning off sensors
BTo increase drone speed for faster delivery
CTo ensure drones maintain safe distances to prevent crashes
DTo synchronize drone cameras for better video quality
Attempts:
2 left
💡 Hint
Think about safety when multiple drones fly close.
🔧 Debug
advanced
2:30remaining
Identify the error in drone task assignment code
What error will this code produce when assigning tasks to drones?
Drone Programming
tasks = ['scan', 'deliver', 'survey']
drones = [{'id': 1}, {'id': 2}]
for i in range(len(tasks)):
    drones[i]['task'] = tasks[i]
print(drones)
ATypeError: 'int' object is not subscriptable
B[{'id': 1, 'task': 'scan'}, {'id': 2, 'task': 'deliver'}]
C[{'id': 1, 'task': 'scan'}, {'id': 2, 'task': 'deliver'}, {'id': 3, 'task': 'survey'}]
DIndexError: list index out of range
Attempts:
2 left
💡 Hint
Check the loop range versus drones list length.
📝 Syntax
advanced
2:00remaining
Syntax error in drone status update function
Which option contains the correct syntax for updating drone status in Python?
Drone Programming
def update_status(drone, status):
    drone['status'] = status
    return drone

# Call example
update_status({'id': 1}, 'active')
A
def update_status(drone, status):
    drone['status'] = status
    return drone
B
def update_status(drone, status):
    drone.status = status
    return drone
C
def update_status(drone, status):
    drone['status'] == status
    return drone
D
def update_status(drone, status)
    drone['status'] = status
    return drone
Attempts:
2 left
💡 Hint
Check function definition and dictionary assignment syntax.
🚀 Application
expert
3:00remaining
Number of unique drone communication pairs
In a fleet of 6 drones, each drone communicates directly with every other drone exactly once. How many unique communication pairs are there?
A30
B15
C12
D36
Attempts:
2 left
💡 Hint
Use the formula for combinations of 6 items taken 2 at a time.