import time import random def printNumbers(numbers): for number in numbers: print "#" * number print "\n" * 3 def insertSort(l): for i in range(1,len(l)): while i > 0 and l[i] <= l[i-1]: l[i], l[i-1] = l[i-1], l[i] i = i - 1 printNumbers(l) time.sleep(0.5) return l insertSort(random.sample(xrange(100),32))