fork download
  1. import heapq
  2.  
  3. lista = [100,3,2,17,19,36,1,25,7]
  4.  
  5. heapq.heapify(lista)
  6. print(lista)
  7.  
  8. menor = heapq.heappop(lista)
  9. print(menor)
  10.  
  11. print(lista)
  12.  
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
[1, 3, 2, 7, 19, 36, 100, 25, 17]
1
[2, 3, 17, 7, 19, 36, 100, 25]