def my_sort(L):
    """
    Sorts a list `L`.

    Parameters
    ----------
    L : list
        The list to be sorted.

    Returns
    -------
    L : list
        Returns `L` after it has been sorted.
    """

    for i in range(0, len(L)-1):
        min_val = L[i] # Set the `i`-th element as the smallest
        min_j = i

        for j in range(i+1, len(L)): # Compares all values after the `i`-th to see if they are smaller
            if L[j] < min_val:
                min_val = L[j]
                min_j = j
            
        temp = L[i] # Replaces the `i`-th value with the smallest value after and including it
        L[i] = min_val
        L[min_j] = temp
    return L