<jupyter_start><jupyter_text>Selection SortSort a given list of numbers in an ascending fashion with selection sort algorithm.<jupyter_code>def selection_sort(L):   
    """
    This function sorts elements of a list of numbers from smaller
    to greater. It takes an element from the list and compares it with 
    all the other elements. It then replaces places with that element if it
    is greater than that element.
    """    
    index = 0    
    while index != len(L):
        for i in range(index, len(L)):            
            if L[i] < L[index]:
                L[index], L[i] = L[i], L[index]                
        index += 1
        print('selection sort: ' + str(L))        
    return L
selection_sort([1,3,45,5,7,-6,2,6,111,25,18,13])<jupyter_output>selection sort: [-6, 3, 45, 5, 7, 1, 2, 6, 111, 25, 18, 13]
selection sort: [-6, 1, 45, 5, 7, 3, 2, 6, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 45, 7, 5, 3, 6, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 3, 45, 7, 5, 6, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 3, 5, 45, 7, 6, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 3, 5, 6, 45, 7, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 45, 111, 25, 18, 13]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 13, 111, 45, 25, 18]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 13, 18, 111, 45, 25]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 13, 18, 25, 111, 45]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 13, 18, 25, 45, 111]
selection sort: [-6, 1, 2, 3, 5, 6, 7, 13, 18, 25, 45, 111]
{'fraction_non_alphanumeric': 0.17146684527796383, 'fraction_numerical': 0.1580709979906229, 'mean_word_length': 2.6262135922330097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '109588', 'license': 'MIT', 'n_tokens_mistral': 793, 'n_tokens_neox': 575, 'n_words': 250, 'path': 'mk009-selection_sort.ipynb', 'repo_name': 'karakose77/intro-to-cs-and-programming-in-python-exercises', 'size': '1493'}