I would like to ensure that all my elements of a list of lists have the same length.
I tried:
assert len((map(len,motifs))) == len(motifs[0])
Then:
assert all(len(m[i]) == len(m[0]) for i, m in enumerate(motifs))
Do you have any clean and quick suggestion?
m
is the sublist, som[i]
andm[0]
don't make sense - it should bem
andmotifs[0]
.