TutorSyntax | Binary search
Level: GCSE / A-level

CHALLENGE
Implement binary search as a subroutine; return the index or -1, without using the in operator or index().

1. Read the starter.py TODO comments and complete the program.
2. Test with typical values, boundary values and invalid input where appropriate.
3. Compare your work with solution.py only after making an attempt.
4. Extension: write at least three automated assert tests.

Runs with Python 3.10+ standard library; no external packages needed.
