[Solved] list comprehension remove 2d list (sublist) from list if length is less than 7 [closed]
[ad_1] For each value in the list, return it, if all the elements of the sublist have length less-than-or-equal-to 6 [x for x in mylist if all(len(y) <= 6 for y in x)] You can also create a list from the singular string elements, but unclear why you’d want this >>> simple_list=[‘apple’, ‘banana’, ‘cantaloupe’, ‘durian’] … Read more