import heapq lista = [100,3,2,17,19,36,1,25,7] heapq.heapify(lista)print(lista)
Standard input is empty
[1, 3, 2, 7, 19, 36, 100, 25, 17]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!