Question: Using Python: a.Write a recursive function that returns true if an object is a member of a given list, or false otherwise. You should use
Using Python: a.Write a recursive function that returns true if an object is a member of a given list, or false otherwise. You should use slicing
Examples: >>> member( 2, [1, 3, 5] ) >>> member( 4, [1, 2, 3, 4, 5] ) False True
b.Modify member() to return the index where the object is found, or -1 otherwise.
Examples: >>> member( 2, [1, 3, 5] ) >>> member( 4, [1, 2, 3, 4, 5] ) -1 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
