def binary_search(nums, target):

    mid_val = len(nums)//2

    print("===============================")
    print("mid_index is ", mid_val)
    print("len of nums is ", len(nums))
    print(nums)
    print(target)

    if target == nums[mid_val]:
        print("Found match value!")
        return nums[mid_val]

    elif len(nums) == 1:
        print("Found closest value!")
        return nums

    elif target < nums[mid_val]:
        binary_search(nums[:mid_val],target)
    else:
        binary_search(nums[mid_val:],target)

num_list = [1,4,6,7,9,10,11,12,15,20,24,59,73,88]
result = binary_search(num_list,12)
print(result)

result = binary_search(num_list,5)
print(result)
===============================
mid_index is  7
len of nums is  14
[1, 4, 6, 7, 9, 10, 11, 12, 15, 20, 24, 59, 73, 88]
12
Found match value!
12
===============================
mid_index is  7
len of nums is  14
[1, 4, 6, 7, 9, 10, 11, 12, 15, 20, 24, 59, 73, 88]
5
===============================
mid_index is  3
len of nums is  7
[1, 4, 6, 7, 9, 10, 11]
5
===============================
mid_index is  1
len of nums is  3
[1, 4, 6]
5
===============================
mid_index is  1
len of nums is  2
[4, 6]
5
===============================
mid_index is  0
len of nums is  1
[4]
5
Result not found.
None