0
0
Drone Programmingprogramming~10 mins

Speed control during mission 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 set the drone's speed to 5 meters per second.

Drone Programming
drone.set_speed([1])
Drag options to blanks, or click blank then click option'
A5
Bspeed
C10
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a number.
Setting speed to 0 which stops the drone.
2fill in blank
medium

Complete the code to increase the drone's speed by 2 meters per second.

Drone Programming
drone.set_speed(drone.speed [1] 2)
Drag options to blanks, or click blank then click option'
A/
B-
C*
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus which decreases speed.
Using multiplication or division which changes speed incorrectly.
3fill in blank
hard

Fix the error in the code to set the drone speed only if it is less than 10.

Drone Programming
if drone.speed [1] 10:
    drone.set_speed(10)
Drag options to blanks, or click blank then click option'
A>
B==
C<
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using greater than which reverses the logic.
Using equality which only matches exactly 10.
4fill in blank
hard

Fill both blanks to create a dictionary of speeds for each waypoint where speed is doubled if altitude is above 100.

Drone Programming
speeds = {wp: drone.speed [1] 2 for wp, alt in waypoints.items() if alt [2] 100}
Drag options to blanks, or click blank then click option'
A*
B+
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Using less than instead of greater than for altitude.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping waypoint names in uppercase to their speeds if speed is above 3.

Drone Programming
speed_map = { [1]: [2] for [3], speed in drone_data.items() if speed > 3 }
Drag options to blanks, or click blank then click option'
Awp.upper()
Bspeed
Cwp
Daltitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using altitude instead of waypoint name.
Using wrong variable names in the loop.