2. Searching

Linear search and break

To find something, check each item in turn until you find it. break stops the loop early, the moment you've found your answer.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:p = "...x.x..". Find the first x: loop i over range(len(p)); when p[i] == "x", play crash(i + 1) and break.

Goal
crash
1234