Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!