Reputation: 13
a = [['yes','no'],['riding','0']['riding',1],['yes','no'],['yes','no'],['riding',2]]
needs to remove all the list that contains riding so it would give me
a = [['yes','no'],['yes','no'],['yes','no']]
I have a big list , and the list that contains riding are in no predictable sequence how do i remove them ? thanks everyone
Upvotes: 0
Views: 49
Reputation:
Using a simple for loop:
for l in a.copy():
if "riding" in l:
a.remove(l)
Upvotes: 1