Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在下面的代码中,heapq.heappop()不检查列表是否已堆积。那为什么会存在这个方法呢?会不会h.pop(0)等价?
heapq.heappop()
h.pop(0)
import heapq h = [10, 4, 6, 8] print(heapq.heappop(h))