[Solved] How to find consecutive strings in nested lists [closed]
Is this what you’re looking for? To initialize the list with the first keyword for row in range(len(locations_and_xy)): if keywords[0] in locations_and_xy[row]: new_locations_and_xy = locations_and_xy[row:] Then we can do this for i in new_locations_and_xy: print ([i for j in keywords if j in i]) [[‘Add’, ‘1215’, ‘697’]] [[‘to’, ‘1241’, ‘698’]] [[‘Cart’, ‘1268’, ‘697’]] Edit To … Read more