def selection_sort(L):
    """
    :param L: unsorted list
    :return: this is a method, there is no return function. The method sorts a list using
      selection sort algorithm

    >>> L = [2, 7, 5, 3]
    >>> selection_sort(L)
    >>> L
    [2, 3, 5, 7]
    """

    end = len(L)

    # Find the index of the smallest element in L[i:] and swap that item
    #   with the item at index i
    for i in range(end):
        index_of_smallest = get_index_of_smallest(L, i)
        L[index_of_smallest], L[i] = L[i], L[index_of_smallest]


def get_index_of_smallest(L, i):
    """
    (list, int) -> int

    :param L: list we want to analyse
    :param i: index from where we want to start
    :return: index of smallest object in the list
    """

    # The index of the smallest item so far
    index_of_smallest = i
    end = len(L)

    for j in range(i + 1, end):
        if L[j] < L[index_of_smallest]:
            index_of_smallest = j

    return index_of_smallest


if __name__ == '__main__':
    import doctest
    doctest.testmod()
@@ -32,121 +32,72 @@
     
-:param L: unsorted list%0A    :return: this is a method, there is no return function. The method sorts a li
+(list) -%3E NoneType%0A%0A    Sort list from smallest to large
 st using
 %0A   
@@ -92,22 +92,16 @@
 st using
-%0A     
  selecti
@@ -119,16 +119,45 @@
 orithm%0A%0A
+    :param L: unsorted list%0A%0A
     %3E%3E%3E 

Improve selection sort algorithm's documentation