What could be causing the IndexError: list index out of range in my_sort function

welcome to shbcf.ru