May-11-2021, 10:28 AM
Hello,
I am trying to run this code. The idea is to compare all elements in the list with another single element. If they are same, process and delete and return the last value. If they are not same just delete:
But I have some troubles in delete part. Here is my code:
I am trying to run this code. The idea is to compare all elements in the list with another single element. If they are same, process and delete and return the last value. If they are not same just delete:
But I have some troubles in delete part. Here is my code:
def func(queue): for index, q in enumerate((queue.copy())): #queue[:]: if q.idt==OP[1]: a=Operation(q,OP[0]) return self.queue.pop(index) #return self.queue.remove(q) elif q.idt < OP[1]: self.unpauli.append(q.idt) self.queue.pop(index) #self.queue.remove(q) #continueI have no error message but the result is coming wrong. Where is the mistake in the code?