Question: Use an iteration loop pattern to implement the function intersect() that takes two lists, each containing no duplicate values, and returns a list containing values
Use an iteration loop pattern to implement the function intersect() that takes two lists, each containing no duplicate values, and returns a list containing values that are present in both lists (i.e. the intersection of the two lists). The information below shows how you would call the function and what it would display for a couple of examples:must write doc strings for each function.Your code should be based on your algorithms. IN PYTHON
X Python 3.7.0 Shell File Edit Shell Debug Options Window Help Python 3.7.0 (V3 . 7.0: 1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD6 4)] on win32 Type "copyright", "credits" or "license)" for more information. RESTART: C: /Users/eve/Documents/evelyn/241/Text/ch05/lab7.py >>>intersect ((4, 2, 6, 8, 10], [4, 2, 6, 3, 9]) [4, 2, 6] >>>intersect ([3, 5, 1, 7, 9], [4, 2, 6, 3, 9]) [3, 9] >>>intersect ('Cat', 'Dog', 'Bird', ['cat', "dog','bird']) >>>intersect (['Skye', 'Isla'] ['MarySkye', 'Kate I'Skye'] 'Alex') Ln: 13 Col: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
