0
0
Drone Programmingprogramming~10 mins

Why swarms multiply drone capability in Drone Programming - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize a drone swarm with 5 drones.

Drone Programming
swarm = DroneSwarm([1])
Drag options to blanks, or click blank then click option'
A5
B10
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or 1 will create no swarm or a single drone, not a swarm.
2fill in blank
medium

Complete the code to make all drones in the swarm take off.

Drone Programming
swarm.[1]()
Drag options to blanks, or click blank then click option'
Atake_off
Bmove
Chover
Dland
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'land' will make drones land instead of taking off.
3fill in blank
hard

Fix the error in the code to command the swarm to move forward by 10 meters.

Drone Programming
swarm.move([1]=10)
Drag options to blanks, or click blank then click option'
Adirection
Bdistance
Cheight
Dspeed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'speed' or 'height' will not specify the movement distance.
4fill in blank
hard

Fill both blanks to create a dictionary that maps each drone's ID to its battery level if battery is above 20%.

Drone Programming
battery_status = {drone.[1]: drone.[2] for drone in swarm if drone.battery > 20}
Drag options to blanks, or click blank then click option'
Aid
Bbattery
Cstatus
Dlocation
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'status' or 'location' will not give the correct keys or values.
5fill in blank
hard

Fill all three blanks to filter drones with battery above 50%, map their IDs to their current altitude, and convert IDs to uppercase.

Drone Programming
altitudes = {drone.[1]: drone.[2] for drone in swarm if drone.[3] > 50}
Drag options to blanks, or click blank then click option'
Aid.upper()
Baltitude
Cbattery
Dlocation
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'location' instead of 'altitude' or forgetting to convert ID to uppercase.