#Find,Remove,Find
"""Return a tuple of the indices of the two smallest values in list L.
    >>> items = [809, 834, 477, 478, 307, 122, 96, 102, 324, 476]
    >>> find_two_smallest(items)
    (6, 7)
    >>> items == [809, 834, 477, 478, 307, 122, 96, 102, 324, 476]
    True
"""

from typing import List, Tuple


def find_two_smallest(L:List[float]) -> Tuple[int, int]:
    """ (see above) """
    # Find the index of the minimum and remove that item
    smallest = min(L)
    min1 = L.index(smallest)
    L.remove(smallest)

    # Find the index of the new minimum item in the list
    next_smallest = min(L)
    min2 = L.index(next_smallest)

    # Put smallest back into L
    L.insert(min1, smallest)

    # Fix min2 in case it was affected by the removal and reinsertion:
    if min1 <= min2:
        min2 +=1
    
    return (min1, min2)
    


if __name__ == '__main__':
    import doctest
    doctest.testmod()
    print(find_two_smallest([0, 1, 3, 2, 5, 6, 1]))

