What goes in the blank?
# always pop the smallest item first smallest = heapq.____(heap)
Answer: heappop
heapq.heappop() removes the smallest element of a min-heap.
Play Problem Solving ▸
# always pop the smallest item first smallest = heapq.____(heap)
Answer: heappop