--- id: 698dcc2c7932b3cc4b19c927 title: Binary Search in Code challengeType: 11 videoId: mg7F5D8Wk5o dashedName: binary-search-in-code --- # --description-- In this video, you will code out the binary search algorithm using Python. # --questions-- ## --text-- Why was the `while first <= last:` condition used in the solution? ## --answers-- To ensure only the first half of the array is ever checked. --- To make the loop run forever until manually stopped. --- To skip checking the last element in the search range. --- To keep searching while there are still elements in the range and stop when the range is empty. ## --video-solution-- 4