l=[5, 4, 2, 1, 0, 8, 7, 4, 6, 1, 0, 7] f=lambda l,S=sorted:zip(*S(S(enumerate(l),key=lambda(i,x):-x)[:5]))[1]print f(l)
Standard input is empty
(5, 8, 7, 6, 7)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!