1def qsort(inlist):
2 if inlist == []:
3 return []
4 else:
5 pivot = inlist[0]
6 lesser = qsort([x for x in inlist[1:] if x < pivot])
7 greater = qsort([x for x in inlist[1:] if x >= pivot])
8 return lesser + [pivot] + greater