I need to create and use n heaps, I am trying to use heapq and is trying to push elements into a list of lists, where each element is to be considered a seperate heap. But its behaving weirdly. I just wanna push the elements 6 and 7 into my 3rd heap. but its getting pushed into all my heaps. any way out of this??
>>> test
[[], [], [], []]
>>>
>>> heappush(test[2],6)
>>> heappush(test[2],7)
>>> test
[[6, 7], [6, 7], [6, 7], [6, 7]]