I am getting below while storing dictionary in heapq. Does anyone know how to solve this ? '<' not supported between instances of 'dict' and 'dict'
import heapq
PQ = []
heapq.heappush(PQ, {"1": "animal"})
heapq.heappush(PQ, {"2": "vechile"})
heapq.heappush(PQ, {"3": "music"})
print(PQ)
heapq.heappush(PQ, {"2": "vechile"})
TypeError: '<' not supported between instances of 'dict' and 'dict'