Question: Searching lists while seemingly trivial, can often have some subtle bugs. Your co-worker Liam has written a function find_first that searches a list for a

 Searching lists while seemingly trivial, can often have some subtle bugs.

Searching lists while seemingly trivial, can often have some subtle bugs. Your co-worker Liam has written a function find_first that searches a list for a given value and returns the index of the first occurrence of an item in a list, or -1 if the item is not found. The function can be called in two different ways: find_first(item, data) to start searching at the first element in the list, or find_first(item, data, start_index) to start searching at the given start_index. Please write some tests that would allow you to check if Liam's function (or anyone else's) is correct. Answer: (penalty regime: 0 % Reset answer Test Result print (find first(1, [0, 1, ]))

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!