def minargmin(sequence):
    """Returns the minimum value and the first index at which it can be
    found in the input sequence."""
    best = None, None
    for i, value in enumerate(sequence):
        if best[0] is None or value < best[0]:
            best = value, i
    return best
