def binary_search(lst: list, value: object) -> int:
    """
    Return the index <i> of the first occurance of <value>
    in the list <lst>, else return -1.

    Precondition: assume that the list is sorted
    """
    start = 0
    end = len(lst) - 1

    while start <= end:
        mid = (start + end) // 2

        if lst[mid] < value:
            start = mid + 1
        else:
            end = mid - 1

    if start == len(lst) or lst[start] != value:
        return -1
    else:
        return start