Implement Insertion sort in Python Task : Implement Insertion Sort in Python.

def insert_sort(a):
""" Fuction to sort a given list a """
    if len(a)==0:
        print "Please give valid input"
    for i in range(1, len(a)):
        current = 0
        while current &lt; i:
            if a[i] &lt; a[current]:
                a[current], a[i]= a[i] , a[current]
            current = current + 1
    return a

print insert_sort([12,54,66,43,11,33,34,33,1,45])


How can this code be better?
As this looks like a school assignment, I'm answering with a bunch of questions for the student of algorithms to ponder:


Why do you think an empty list should be invalid input?
Could you think of a more descriptive name for the parameter than a?
You have a loop from 1 to length of array. This looks like an off by one error. Normally one would loop over indexes of 0..length-1. Could this loop be improved so it doesn't look suspicious?
Why are you using an outer for-loop and an inner while loop? Why not not in reverse? Why not use the same looping construct for both?
As this is an insertions sort, how do you perform an insertion to Python list, and where in this code is that insertion used?
How can you make sure that this solution really works? Could you write an automated test to check that it's correctly sorting various inputs?