def get_nearest_station(my_latitude: float, my_longitude: float, stations: List['Station']) -> int: """Return the id of the station from stations that is nearest to the location given by my_latidute...


complete the docstring using the information provided:


def get_nearest_station(my_latitude: float, my_longitude: float,<br>stations: List['Station']) -> int:<br>
1 >>> get_nearest_station(43.671134, -79.325164, SAMPLE_STATIONS) 7571 >>> get_nearest_station(43.674312, -79.299221, SAMPLE_STATIONS) 7486 II II I| "/>
Extracted text: def get_nearest_station(my_latitude: float, my_longitude: float, stations: List['Station']) -> int: """Return the id of the station from stations that is nearest to the location given by my_latidute and my_longitude. In the case of a tie, return the ID of the last station in stations with that distance. Preconditions: len(stations) > 1 >>> get_nearest_station(43.671134, -79.325164, SAMPLE_STATIONS) 7571 >>> get_nearest_station(43.674312, -79.299221, SAMPLE_STATIONS) 7486 II II I|
# A set of constants, each representing a list index for station information.<br>ID = 0<br>NAME = 1<br>LATITUDE<br>2<br>LONGITUDE = 3<br>САРАСІTY 3D 4<br>BIKES_AVAILABLE<br>= 5<br>DOCKS_AVAILABLE = 6<br>NO_KIOSK = 'SMART'<br># For use in the get_lat_lon_distance helper function<br>EARTH_RADIUS = 6371<br># SAMPLE DATA TO USE IN DOCSTRING EXAMPLES<br>SAMPLE_STATIONS<br>[7090, 'Danforth Ave / Lamb Ave',<br>43.681991, -79.329455, 15, 4, 10],<br>[7486, 'Gerrard St E / Ted Reeve Dr',<br>43.684261, -79.299332, 24, 5, 19],<br>[7571, 'Highfield Rd / Gerrard St E<br>43.671685, -79.325176, 19, 14, 5]]<br>SMART',<br>HANDOUT_STATIONS<br>[7000, 'Ft. York / Capreol Crt.',<br>43.639832, -79.395954, 31, 20, 11],<br>[7001, 'Lower Jarvis St SMART / The Esplanade',<br>43.647992, -79.370907, 15, 5, 10]]<br>

Extracted text: # A set of constants, each representing a list index for station information. ID = 0 NAME = 1 LATITUDE 2 LONGITUDE = 3 САРАСІTY 3D 4 BIKES_AVAILABLE = 5 DOCKS_AVAILABLE = 6 NO_KIOSK = 'SMART' # For use in the get_lat_lon_distance helper function EARTH_RADIUS = 6371 # SAMPLE DATA TO USE IN DOCSTRING EXAMPLES SAMPLE_STATIONS [7090, 'Danforth Ave / Lamb Ave', 43.681991, -79.329455, 15, 4, 10], [7486, 'Gerrard St E / Ted Reeve Dr', 43.684261, -79.299332, 24, 5, 19], [7571, 'Highfield Rd / Gerrard St E 43.671685, -79.325176, 19, 14, 5]] SMART', HANDOUT_STATIONS [7000, 'Ft. York / Capreol Crt.', 43.639832, -79.395954, 31, 20, 11], [7001, 'Lower Jarvis St SMART / The Esplanade', 43.647992, -79.370907, 15, 5, 10]]
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here