I am using Python 3.6 I have a list:
listA = [1,2,3,1,2,4]
I am trying to remove the repetitive items from the list, so the final list will be
listA = [3,4]
After I loop once and remove 1s from the list using pop, my loop automatically advances to 3, instead of 2. To avoid this, I used following logic:
ListB= ListA
ListA.clear()
ListA = ListB
but once I clear ListA, the other list ListB is also getting cleared automatically. How can I avoid this or solve this issue?