Two simple sorting algorithms in Python
The docstrings and doctests are nice.  I would prefer a more explicit description of the behaviour: "Return a copy of the array, sorted using the bubble sort algorithm."  Typically, if you're implementing these sorting algorithms as an exercise, you would perform the sorting in place.



In bubble_sort(), the while last_index &gt; 0 loop would be written more idiomatically as:

for last_index in range(len(array) - 1, 0, -1):
    …




In insertion_sort(), the reversed(list(enumerate(sorted_array))) would be making temporary copies of sorted_array.  I would therefore consider it an improper implementation of the algorithm.