I have a list of the same type object. And i want to iterate that list and remove the object in it which reach a special condition. as follow:
    links = [{"source":0, "target":1}, ....]
    for link in links:
        if {"source":link["target"], "target":link["sourcec"]} not in links:
            links.remove(link)
but i find the for loop didn't access each element in list. so i guess the for loop based the index of the list. is there a good way to do that remove operation?
 
     
     
     
     
    