Linear Search in Python
Linear search checks each item from start to end until it finds the target. Works on unsorted lists. Worst case you look at all n items — O(n). Code is a for-loop and an if. Acceptable on small lists or when data is not sorted. On a huge sorted list, binary search is the better story.
Trace [4, 1, 3, 2] looking for 3: check 4, check 1, check 3 — found. Say O(n) honestly. Don’t claim it is “always slow” — for n=10 it is fine.
Linear Search in Python — output — 1. 90 is at index 1. If missing, found stays -1.
When linear search is acceptable.