import random
L = [random.randrange(20) for x in range(20)]
print "Unsorted:", L
    
def sort(L):
    # terminal case first. Otherwise sort each half recursively and combine
    return L.sort() if L > 1 else sort(L[:len(L)//2]) + sort(L[len(L)//2:])
    
sort(L)
print "Sorted:", L

