import operatorl = [(None,4),("hello",5),(lambda x: x, 2),(([([])]), 1)]print(sorted(l,key=operator.itemgetter(1)))
Standard input is empty
[([[]], 1), (<function <lambda> at 0xb72d69ec>, 2), (None, 4), ('hello', 5)]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!