[len(x) for x in a[0]]
?
>>> a = []
>>> a.append([])
>>> a[0].append([1,2,3,4,5])
>>> a[0].append([1,2,3,4])
>>> a[0].append([1,2,3])
>>> [len(x) for x in a[0]]
[5, 4, 3]
More Related Contents:
- Shuffling a list of objects
- Pandas column of lists, create a row for each list element
- What is the difference between `sorted(list)` vs `list.sort()`?
- What do ellipsis […] mean in a list?
- How can I get list of values from dict?
- Converting a string representation of a list into an actual list object [duplicate]
- Apply function to each element of a list
- Python list rotation [duplicate]
- List on python appending always the same value [duplicate]
- Why does ‘.sort()’ cause the list to be ‘None’ in Python? [duplicate]
- Python assigning multiple variables to same value? list behavior
- Python’s insert returning None?
- Convert NumPy array to Python list
- why sum on lists is (sometimes) faster than itertools.chain?
- First Python list index greater than x?
- Is it possible to get a list of keywords in Python?
- Get number of items from list (or other iterable) with certain condition
- How to append multiple values to a list in Python
- How to remove square brackets from list in Python? [duplicate]
- Unexpected list behavior in Python
- Slicing a list into n nearly-equal-length partitions [duplicate]
- How to return all list elements of a given length?
- Given parallel lists, how can I sort one while permuting (rearranging) the other in the same way?
- python remove duplicates from 2 lists
- Convert a number to a list of integers [duplicate]
- Unexpected Behavior of Extend with a list in Python [duplicate]
- If in Python I put a list inside a tuple, can I safely change the contents of that list? [duplicate]
- How to change variables fed into a for loop in list form
- Length of longest word in a list
- list extend() to index, inserting list elements not only to the end