title: How to Sort List Items from Low to High Without Built-In Tools
body: <p>I'm trying to write this function <code>gensort(list)</code> that takes a list of numbers and returns a new list with the same numbers, but ordered from low to high. An example of the output would be something like </p>
  
  <pre><code>&gt;&gt;&gt; gensort([111, 1, 3.14])
  [1, 3.14, 111]
  </code></pre>
  
  <p>I wrote a function to take one element and return it to its place in ascending oder:</p>
  
  <pre><code>def insert_sorted(elem,list):
         if list == []:
             return [elem]
         elif elem &lt; list[0]:
             return [elem] + list
         else:
             return [list[0]] + insert_sorted(elem, list[1:])
  </code></pre>
  
  <p>Now I'm trying to apply it to the rest of my list and I came up with this:</p>
  
  <pre><code>def gensort(list):
      insert = insert_sorted(list[min],list)
      return insert 
  </code></pre>
  
  <p>However, this doesn't work in the least. I'm wondering how I can use insert_sorted recursively, or write a different list comprehension to get it to return the correct order for my whole list.</p>
  
  <p>I know there are built in sorting tools but I'm trying to write this with what I've got currently. </p>