0
0
Drone Programmingprogramming~10 mins

GPS coordinate system (latitude, longitude, altitude) 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 create a GPS coordinate with latitude 40.7128.

Drone Programming
coordinate = {'latitude': [1], 'longitude': -74.0060, 'altitude': 10}
Drag options to blanks, or click blank then click option'
A10
B74.0060
C-74.0060
D40.7128
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing latitude with longitude.
Using altitude value for latitude.
2fill in blank
medium

Complete the code to print the longitude from the coordinate dictionary.

Drone Programming
print(coordinate[[1]])
Drag options to blanks, or click blank then click option'
A'longitude'
B'altitude'
C'location'
D'latitude'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'latitude' instead of 'longitude'.
Forgetting quotes around the key.
3fill in blank
hard

Fix the error in the code to correctly update the altitude to 20.

Drone Programming
coordinate[[1]] = 20
Drag options to blanks, or click blank then click option'
A'altitude'
B'height'
Calt
Daltitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using key without quotes causing a NameError.
Using wrong key name.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that stores coordinates with altitude above 15.

Drone Programming
{coord['latitude']: coord[[1]] for coord in coordinates if coord[[2]] > 15}
Drag options to blanks, or click blank then click option'
A'altitude'
B'longitude'
C'latitude'
D'height'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys like 'longitude' or 'height'.
Mixing keys between blanks.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping latitude to longitude for coordinates below altitude 50.

Drone Programming
{coord[[1]]: coord[[2]] for coord in coordinates if coord[[3]] < 50}
Drag options to blanks, or click blank then click option'
A'latitude'
B'longitude'
C'altitude'
D'height'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys in mapping or condition.
Confusing altitude with height.