Let's say I have this list:
li = [["0", "20", "ar"], ["20", "40", "asdasd"], ["50", "199", "bar"], ["24", "69", "sarkozy"]]
Now, forget about the numbers, this is what allowed me to recognize the position of the line. So basically, given that I have the string "ar" in my hand, how can I extract all lists containing "ar"?
new_li = [["50", "199", "bar"], ["24", "69", "sarkozy"]]
How can I get this list?
source share