mixed = [1, 1.5, 2, 2.5, 3]mixed.sort()print mixedmixed.sort(key=int)print mixedmixed.sort(key=float)print mixed
Standard input is empty
[1, 1.5, 2, 2.5, 3] [1, 1.5, 2, 2.5, 3] [1, 1.5, 2, 2.5, 3]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!