Searching lists while seemingly trivial, can often have some subtle bugs. Your c
ID: 3749636 • Letter: S
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 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, «]))Explanation / Answer
Answer
Explanation
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.