Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to make the drone take off.
Drone Programming
drone.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'land' instead of 'take_off' will make the drone land.
✗ Incorrect
The take_off() method makes the drone lift off the ground.
2fill in blank
mediumComplete the code to make the drone fly forward by 10 meters.
Drone Programming
drone.move_forward([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a smaller or larger number will move the drone the wrong distance.
✗ Incorrect
Passing 10 makes the drone move forward 10 meters.
3fill in blank
hardFix the error in the code to check if the drone's battery is above 20%.
Drone Programming
if drone.battery_level [1] 20:
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' will check if battery is less than 20, which is wrong here.
✗ Incorrect
The '>' operator checks if battery level is greater than 20%.
4fill in blank
hardFill both blanks to create a dictionary of drone sensors with their status.
Drone Programming
sensors_status = {"camera": [1], "gps": [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up True/False or using strings instead of booleans.
✗ Incorrect
The camera is active (True) and GPS is inactive ("inactive") in this example.
5fill in blank
hardFill all three blanks to filter drone data for sensors with values above 50.
Drone Programming
filtered_data = {k: v for k, v in drone_data.items() if v [1] [2] and k [3] "temperature"} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '!=' will only keep temperature sensor.
✗ Incorrect
This code keeps sensors with values greater than 50 and excludes the temperature sensor.