I am attempting to remove a tuple from a list based on its contents. The example illustrates what I have attempted to do:
i=[(a,0),(b,''),(c,5)]
The goal is to remove the tuple with an empty value in the second space. The final list would look like this:
i=[(a,0),(c,5)]
I have attempted to achieve this using the code:
for p in i:
if '' in p[1]:
i.remove(p)
However, if I print i
at this point the list has no changes done to it. Where might I be going wrong?