def binary_search(item, list):
    """
    This function is an implementation of a binary search

    Parameters:
    item, list

    Returns:
    True or False depending if the item is found or not
    """
    found = False
    counter = 0
    bottom_of_list = 0
    top_of_list = len(list) - 1
    while bottom_of_list <= top_of_list and not found:
        middle_of_list = (bottom_of_list + top_of_list) // 2
        if list[middle_of_list] == item:
            found = True
        elif item > list[middle_of_list]:
            bottom_of_list = middle_of_list + 1
        else:
            top_of_list = middle_of_list - 1
        counter += 1
    print(' Number of searches before finding the item: ' + str(counter))
    return found
