Question: IAT&T 4:30 PM cs.buedu 1. Write a tunction find(elem, seq) that 100% takes as inputs an element elem and a sequence seq, and that uses
IAT&T 4:30 PM cs.buedu 1. Write a tunction find(elem, seq) that 100% takes as inputs an element elem and a sequence seq, and that uses recursion to find and return the index of the first occurrence of elem in seq. The sequence seq can be either a list or a string. If seq is a string, elem Will be a single-character string if seq is a list, elem can be any value. Don't forget that the index of the first element in a sequence is 0 Important notes If elem is not an element of seq, the function should return -1 * You may not use the in operator in this function Here are some examples >>> find (5, [4, 10, 5, 3, 7, 5]) 2 >>> find ('hi',['well', 'hi', 't >>> find ('b', 'banana') >>> find('a', 'banana') >>> find('i', 'team')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
