import timeit

def insertion(_list):
    '''Sorts a list via the insertion method.'''
    if type(_list) is not list:
        raise TypeError('Entire list must be numbers')
    for i in range(1, len(_list)):

        key = _list[i]
        if not isinstance(key, int):
            raise TypeError('Entire list must be numbers')
        position = i

        while position > 0 and _list[position-1] > key:
            _list[position] = _list[position-1]
            position = position-1

        _list[position] = key

    return _list

if __name__ == '__main__':
    input = [1, 3, 2]
    output = insertion(input)
    print output

    timeit.timeit(insertion(input))

@@ -8,11 +8,332 @@
 time
-it%0A
+%0A%0A%0Adef timed_func(func):%0A    %22%22%22Decorator for timing our traversal methods.%22%22%22%0A    def timed(*args, **kwargs):%0A        start = time.time()%0A        result = func(*args, **kwargs)%0A        elapsed = time.time() - start%0A        # print %22time expired: %25s%22 %25 elapsed%0A        return (result, elapsed)%0A    return timed%0A%0A%0A@timed_func
 %0Adef
@@ -852,16 +852,18 @@
  _list%0A%0A
+%0A%0A
 if __nam
@@ -889,106 +889,1038 @@
     
-input
+lengths
  = %5B1
+0
 , 
-3, 2%5D%0A    output = insertion(input)%0A    print output%0A%0A    timeit.timeit(insertion(input))
+100, 1000, 10000%5D%0A    times = %5B%5D%0A    for x in lengths:%0A        output = insertion(range(x))%0A        times.append(output%5B1%5D)%0A    print 'Best case scenario:'%0A    for length, tim in zip(lengths, times):%0A        print 'a list of length %7B%7D was sorted in %7B%7D'.format(length, tim)%0A    diff = %5B%5D%0A    for x in range(len(times)-2):%0A        diff.append(times%5Bx+1%5D/times%5Bx%5D)%0A    average = reduce(lambda x, y: x+y, diff) / len(diff)%0A    print 'As length increases by 10, time increases by %7B%7D'.format(average)%0A%0A    lengths = %5B10, 100, 1000, 10000%5D%0A    times = %5B%5D%0A    for x in lengths:%0A        output = insertion(range(x)%5B::-1%5D)%0A        times.append(output%5B1%5D)%0A    print 'Worse case scenario:'%0A    for length, tim in zip(lengths, times):%0A        print 'a list of length %7B%7D was sorted in %7B%7D'.format(length, tim)%0A    diff = %5B%5D%0A    for x in range(len(times)-2):%0A        diff.append(times%5Bx+1%5D/times%5Bx%5D)%0A    average = reduce(lambda x, y: x+y, diff) / len(diff)%0A    print 'As length increases by 10, time increases by %7B%7D'.format(average)%0A%0A
 %0A

Add timing to show time complexity.