mercredi 30 décembre 2015

Python: Filtering out sublist from list based on contents of entire sublist?

So here is what I have:

lst = [["111","101","000"]["1001","1100","1111"]["00","11","00"]]

And I want to filter out the sublists that contain only strings of "0"*len(string) and "1"*len(string). The result should look like this:

[["111","101","000"]["1001","1100","1111"]]

This seems like it should be fairly easy but I can't seem to figure it out! Help would be greatly appreciated!

Aucun commentaire:

Enregistrer un commentaire