Insertion sort using recursive function in python : <p>I was trying to implement insertion sort using a recursive function.</p>

<pre><code>def insertion_sort(arr):
    found=False
    #Base case when list has only one element
    if len(arr)==1:
        return arr
    else:
    '''
        insert nth element in appropriate postion in a sorted list of n-1 elements
    '''    
        partial_list=insertion_sort(arr[:len(arr)-1]
        element=arr[-1]
        for i in range(len(partial_list)):
            if partial_list[i]&gt;element:
                index=i
                found=True
                break
        if found:
            return partial_list.insert(index,element)
        else:
            return partial_list.append(element)
</code></pre>

<p>But its showing an error:  for i in range(len(partial_list)):
                           TypeError: object of type 'NoneType' has no len(). 
Can anyone please explain why partial_list is a 'None' type object; even though function insertion_sort is returning a list?</p>
