write a function get_number_stops(start, end) that returns the number of stops (a positive number) between the start and the end , or -1 if the start and end are not on the same line. use python

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

write a function

get_number_stops(start, end) that returns the number of stops (a positive number) between the start and the end , or -1 if the start and end are not on the same line.

use python

Boston Subway
The Boston Subway e has four different colored trains, some of which have multiple
routes. We have simplified the routes so that each train has a single route with the
following stations (in order from north to south) and that each colored line intersects
with another colored line at exactly one station.
• Red Line: Alewife, Davis, Porter, Harvard, Central, Kendall/MIT, Charles/MGH,
Downtown Crossing, South Station, Broadway, Andrew, JFK/UMass
• Orange Line: Oak Grove, Malden Center, Wellington, Assembly, Sullivan Square,
Community College, North Station, Haymarket, State, Downtown Crossing,
Chinatown, Tufts Medical Center, Back Bay, Mass Avenue, Ruggles, Roxbury
Crossing, Jackson Square, Stony Brook, Green Street, Forest Hills
• Blue Line: Wonderland, Revere Beach, Beachmont, Suffolk Downs, Orient Heights,
Wood Island, Airport, Maverick, Aquarium, State
• Green Line: Haymarket, Government Center, Park Street, Boylston, Arlington,
Copley, Haynes Convention Center, Kenmore, Blandford Street, Boston University
East, Boston University Central, Boston University West, Saint Paul Street,
Pleasant Street, Babcock Street, Packards Corner, Harvard Avenue, Griggs Street,
Allston Street, Warren Street, Washington Street, Sutherland Road, Chiswick Road,
Chestnut Hill Avenue, South Street, Boston College
Station names must match exactly (unforgiving about upper/lowercase and
abbreviations) with the exception of names that have a "/" in them. These stations can
be referred to be either one. For example, both "Kendall" and "MIT" refer to the same
station.
Note: The simplification of our train lines is such that each line intersects with other
lines in exactly one station. But not all lines intersect every other line.
Transcribed Image Text:Boston Subway The Boston Subway e has four different colored trains, some of which have multiple routes. We have simplified the routes so that each train has a single route with the following stations (in order from north to south) and that each colored line intersects with another colored line at exactly one station. • Red Line: Alewife, Davis, Porter, Harvard, Central, Kendall/MIT, Charles/MGH, Downtown Crossing, South Station, Broadway, Andrew, JFK/UMass • Orange Line: Oak Grove, Malden Center, Wellington, Assembly, Sullivan Square, Community College, North Station, Haymarket, State, Downtown Crossing, Chinatown, Tufts Medical Center, Back Bay, Mass Avenue, Ruggles, Roxbury Crossing, Jackson Square, Stony Brook, Green Street, Forest Hills • Blue Line: Wonderland, Revere Beach, Beachmont, Suffolk Downs, Orient Heights, Wood Island, Airport, Maverick, Aquarium, State • Green Line: Haymarket, Government Center, Park Street, Boylston, Arlington, Copley, Haynes Convention Center, Kenmore, Blandford Street, Boston University East, Boston University Central, Boston University West, Saint Paul Street, Pleasant Street, Babcock Street, Packards Corner, Harvard Avenue, Griggs Street, Allston Street, Warren Street, Washington Street, Sutherland Road, Chiswick Road, Chestnut Hill Avenue, South Street, Boston College Station names must match exactly (unforgiving about upper/lowercase and abbreviations) with the exception of names that have a "/" in them. These stations can be referred to be either one. For example, both "Kendall" and "MIT" refer to the same station. Note: The simplification of our train lines is such that each line intersects with other lines in exactly one station. But not all lines intersect every other line.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education