0
0
Drone Programmingprogramming~10 mins

Altitude limits configuration 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 maximum altitude limit to 120 meters.

Drone Programming
drone.set_max_altitude([1])
Drag options to blanks, or click blank then click option'
A150
B120
C100
D200
Attempts:
3 left
💡 Hint
Common Mistakes
Using a value lower or higher than 120 will not set the correct altitude limit.
2fill in blank
medium

Complete the code to check if the current altitude exceeds the minimum altitude limit of 10 meters.

Drone Programming
if drone.current_altitude [1] 10:
Drag options to blanks, or click blank then click option'
A>
B<
C==
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' would check if altitude is below 10 meters, which is incorrect here.
3fill in blank
hard

Fix the error in the code to correctly set both minimum and maximum altitude limits.

Drone Programming
drone.set_altitude_limits(min=[1], max=120)
Drag options to blanks, or click blank then click option'
A5
B150
C-10
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting a negative minimum altitude causes errors.
4fill in blank
hard

Fill both blanks to create a dictionary of altitude limits with keys 'min' and 'max'.

Drone Programming
altitude_limits = {'min': [1], 'max': [2]
Drag options to blanks, or click blank then click option'
A0
B120
C100
D-5
Attempts:
3 left
💡 Hint
Common Mistakes
Using negative values or wrong maximum altitude values.
5fill in blank
hard

Fill all three blanks to filter altitude readings between minimum and maximum limits.

Drone Programming
valid_altitudes = [alt for alt in readings if alt [1] min_limit and alt [2] max_limit and alt != [3]]
Drag options to blanks, or click blank then click option'
A>
B<
CNone
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong comparison operators or not excluding None values.