one-file-projects/sorter.py
2014-08-31 06:14:41 +02:00

7 lines
126 B
Python

#!/usr/bin/env python
a = [ [5,2,3], [1], [6,1,9], [2,0] ]
a = sorted(a, key = lambda item: sum(item)/len(item) )
print(a)