Question: QUESTION 2. myContains that returns true if elem is in the list and false otherwise is given. >myContains(12,-8,1,3,411) True myContains(12,-8,1,3,410) False myContains(12,-8,1,3,414) True >>> mycontainsi
QUESTION 2. myContains that returns true if elem is in the list and false otherwise is given. >myContains(12,-8,1,3,411) True myContains(12,-8,1,3,410) False myContains(12,-8,1,3,414) True >>> mycontainsi 2,4,1,3,49 False Define a function myContainsindex(list,elem) that returns -1 if elem in not in the list. If elem is in the list, the function returns the index of list where elem is found in the list,. For example (compare against above): omyContainsindex([2,-8,1,3,411) myContainsindes12-8.1,3,4L0 xo myContainsindext(2-8,1,3,414) ox myContainslndex(2-8.1.3,415) > myContainsindext12-8.1,3,415) 25 31
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
