Complete the code to create a GPS coordinate with latitude 40.7128.
coordinate = {'latitude': [1], 'longitude': -74.0060, 'altitude': 10}The latitude value is 40.7128, which represents the north-south position.
Complete the code to print the longitude from the coordinate dictionary.
print(coordinate[[1]])
Longitude is accessed by the key 'longitude' in the coordinate dictionary.
Fix the error in the code to correctly update the altitude to 20.
coordinate[[1]] = 20
Dictionary keys must be strings in quotes to update the value correctly.
Fill both blanks to create a dictionary comprehension that stores coordinates with altitude above 15.
{coord['latitude']: coord[[1]] for coord in coordinates if coord[[2]] > 15}We filter coordinates where altitude is greater than 15 and map latitude to altitude.
Fill all three blanks to create a dictionary mapping latitude to longitude for coordinates below altitude 50.
{coord[[1]]: coord[[2]] for coord in coordinates if coord[[3]] < 50}The dictionary maps latitude to longitude for coordinates where altitude is less than 50.