Skip to content

Searching · warm-up

Where is it?

Write index_of(items, target) returning the position of the first target in the list, or -1 if it is not there — without .index().

Run adds print(index_of([4, 8, 15], 8)) after your code, to try it.

Stuck on the idea rather than the code? The Searching lesson walks through it.