Here\'s a Python implementation of insertion sort, I tried to follow the values on paper but once the counting variable i gets bigger than len(s) I don\'t know what to do, h
A simple combination of list slicing and bubble sort
s = [54,26,93,17,77,31,44,55,20]
for i in range(1,len(s)+1):
b = s[0:i]
a = b
count = 0
while count= a[j+1-len(a)]:
temp = a[j]
a[j] = a[j+1-len(a)]
a[j+1-len(a)] = temp
count = count+1
print a