def insertion_sort(nums):
for i in range(1, len(nums)):
key = nums[i]
j = i-1
while j >= 0 and nums[j] > key:
nums[j+1] = nums[j]
j -= 1
nums[j+1] = key
nums = [12, 11, 13, 5, 6]
insertion_sort(nums)
print(nums)
# [5, 6, 11, 12, 13]