0
0
Drone Programmingprogramming~10 mins

Search and rescue assistance in Drone Programming - Interactive Code Practice

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

Complete the code to start the drone's search mode.

Drone Programming
drone.[1]()
Drag options to blanks, or click blank then click option'
Atakeoff
Bland
Chover
Dshutdown
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'land' instead of 'takeoff' will stop the drone immediately.
2fill in blank
medium

Complete the code to check if the drone has found a person.

Drone Programming
if drone.detect_person() [1] True:
Drag options to blanks, or click blank then click option'
A==
B!=
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' will check for no detection, which is wrong here.
3fill in blank
hard

Fix the error in the code to send a rescue signal when a person is found.

Drone Programming
if drone.detect_person() == True:
    drone.[1]('rescue_signal')
Drag options to blanks, or click blank then click option'
Areceive
Bwait
Csend
Dstop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'receive' or 'wait' will not send the signal.
4fill in blank
hard

Fill both blanks to create a dictionary of detected persons with their distances.

Drone Programming
detected = {person: drone.[1](person) for person in drone.[2]()}
Drag options to blanks, or click blank then click option'
Adistance_to
Baltitude
Cdetected_persons
Dbattery_level
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'altitude' or 'battery_level' will not give correct distances or persons.
5fill in blank
hard

Fill all three blanks to filter persons within 100 meters and prepare rescue messages.

Drone Programming
close_persons = {person: dist for person, dist in detected.items() if dist [1] 100}
messages = [f"Rescue needed for [2] at [3] meters" for person, dist in close_persons.items()]
Drag options to blanks, or click blank then click option'
A<
Bperson
Cdist
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' will select persons farther than 100 meters, which is wrong.