find_index_or_report(nums, target) that searches nums for target using a for...else construct: if found, return its index immediately (breaking the loop); if the loop completes without finding it, the else clause should return -1.find_index_or_report([4, 8, 15, 16], 15)
2
15 is at index 2.
find_index_or_report([4, 8, 15, 16], 99)
-1
Loop completes without a break, so else runs.
The `else` block on a for loop only executes if the loop was never `break`-ed out of.
Use `enumerate()` to get both index and value while iterating.