0
0
Drone Programmingprogramming~10 mins

GPS data processing 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 extract the latitude from the GPS data dictionary.

Drone Programming
latitude = gps_data[1]
Drag options to blanks, or click blank then click option'
A['latitude']
B[latitude]
C.latitude
Dlatitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using dot notation instead of square brackets for dictionary access.
Forgetting to put the key name in quotes.
2fill in blank
medium

Complete the code to calculate the distance between two GPS points using the Haversine formula.

Drone Programming
distance = 2 * radius * math[1](math.sqrt(a))
Drag options to blanks, or click blank then click option'
A.tan
B.sin
C.cos
D.asin
Attempts:
3 left
💡 Hint
Common Mistakes
Using sine instead of arcsine.
Using cosine or tangent which are incorrect here.
3fill in blank
hard

Fix the error in the code to convert GPS coordinates from degrees to radians.

Drone Programming
lat_rad = math[1](lat_deg)
Drag options to blanks, or click blank then click option'
A.degrees
B.radians
C.to_radians
D.convert
Attempts:
3 left
💡 Hint
Common Mistakes
Using math.degrees() which converts radians to degrees.
Using non-existent functions like to_radians or convert.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each GPS point's ID to its altitude if altitude is above 100 meters.

Drone Programming
altitudes = {point[1]: data[2] for point, data in gps_points.items() if data['altitude'] > 100}
Drag options to blanks, or click blank then click option'
A['id']
B['altitude']
C.id
D.altitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using dot notation which does not work for dictionaries.
Mixing up keys and values in the comprehension.
5fill in blank
hard

Fill both blanks to filter GPS points with latitude greater than 40, and create a dictionary with uppercase IDs as keys and their longitude as values.

Drone Programming
filtered = {point[1]: data[2] for point, data in gps_data.items() if data['latitude'] > 40}
Drag options to blanks, or click blank then click option'
A{
B.upper()
C['longitude']
D['id']
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the opening curly brace for the dictionary.
Not converting the point ID to uppercase.
Using wrong key names or dot notation.