def METHOD_NAME(element, list_):
    """
    find previous element in a sorted list
    >>> find_previous(0, [0])
    (0, 0)
    >>> find_previous(2, [1, 1, 3])
    (1, 1)
    >>> find_previous(0, [1, 2])
    (None, None)
    >>> find_previous(1.5, [1, 2])
    (1, 0)
    >>> find_previous(3, [1, 2])
    (2, 1)
    """
    length = len(list_)
    for index, current in enumerate(list_):
        # current is the last element
        if length - 1 == index:
            return current, index
        # current is the first element
        if index == 0:
            if element < current:
                return None, None
        if current <= element < list_[index+1]:
            return current, index
    return None, None