one-file-projects/sorter.py

8 lines
126 B
Python
Raw Normal View History

2014-08-31 06:14:41 +02:00
#!/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)