Insertion sort

This is how most people sort a hand of cards. Keep the left part of the list sorted. Take the next unsorted value, and move it leftwards past every larger value until it is in the right place among the sorted ones. The sorted part grows by one each time.

Write insertion_sort(nums) that sorts the list in place using this method and returns it. Do not use sort or sorted.

insertion_sort([5, 1, 4, 2])  ->  [1, 2, 4, 5]
def insertion_sort(nums):
    ...