Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

complete the doctring using the information below:

# A set of constants, each representing a list index for station information.
ID = 0
NAME = 1
LATITUDE = 2
LONGITUDE = 3
CAPACITY = 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 - SMART',
43.671685, -79.325176, 19, 14, 5]]
%3D
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]]
def get_column_sum(index: int, stations: List["Station"]) -> int:
"""Return the sum of the values at the given index from each inner list
of stations.
Precondition: the items in stations at the position
that index refers to are ints.
>>> get_column_sum(BIKES_AVAILABLE, SAMPLE_STATIONS)
23
>>> get_column_sum(DOCKS_AVAILABLE, SAMPLE_STATIONS)
34
II II||
expand button
Transcribed Image Text:# A set of constants, each representing a list index for station information. ID = 0 NAME = 1 LATITUDE = 2 LONGITUDE = 3 CAPACITY = 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 - SMART', 43.671685, -79.325176, 19, 14, 5]] %3D 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]] def get_column_sum(index: int, stations: List["Station"]) -> int: """Return the sum of the values at the given index from each inner list of stations. Precondition: the items in stations at the position that index refers to are ints. >>> get_column_sum(BIKES_AVAILABLE, SAMPLE_STATIONS) 23 >>> get_column_sum(DOCKS_AVAILABLE, SAMPLE_STATIONS) 34 II II||
The first parameter represents an inner list index and the second parameter represents
converted stations data.
get_column_sum
The function should return the sum of the values at the given index from each inner list of
(int, List["Station"])
->
the converted stations data.
int
You can assume that the given index is valid for the given data, and that the items in the list
at the given index position are integers.
expand button
Transcribed Image Text:The first parameter represents an inner list index and the second parameter represents converted stations data. get_column_sum The function should return the sum of the values at the given index from each inner list of (int, List["Station"]) -> the converted stations data. int You can assume that the given index is valid for the given data, and that the items in the list at the given index position are integers.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY