Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Filename: ppp _ 2 . py Write the following function: * name: filter _ line * parameters: string, list, list * returns: filtered / smaller

Filename: ppp_2.py
Write the following function:
* name: filter_line
* parameters: string, list, list
* returns: filtered/smaller version of second list
Given...
- the name of an MBTA line (green, orange, red, etc.)
- a list of MBTA lines (green line, orange line, etc.)
- a second list that corresponds with the first (same size)
Return...
- a filtered version of the second list.
For example, given:
"green", ["green line", "red line", "green line"],[3,4,5]
Your function should return a filtered version of the second list,
wherever "green" was found in the first:
[3,5]
Because the file we're working with uses different names for the lines,
your function should be able to take in "green" or "Green" and find the
corresponding value "green line" or "Green Line" or "GREEN LINE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions