I have the following strange behaveiour in my program and I would be very thankful if somebody can please help me.
data = [1, 4, 5, 6, 10, 15, 16, 17, 18, 22, 25, 26, 27, 28]
datacopy = copy.deepcopy(data)
for i in datacopy:
datacopy.remove(i)
I would suspect datacopy to be an empty list after this, but strangely datacopy=[4, 6, 15, 17, 22, 26, 28]. The problem seems to be that i does not get every element of datacopy, which is something I do not understand.
Thanks for your support!