# The way that Code.org teaches Recursive Binary Search def binarySearch(nums, left, right, target): if left>right: return -1 middle = (left+right)//2 if target < nums[middle]: return binarySearch(nums,left, middle-1, target) elif target > nums[middle]: return binarySearch(nums,left+1, middle, target) else: return middle test_list = [2,4,6,8,10,12,14,16,18,20] result = binarySearch(test_list,0,len(test_list),6) print(result)