if i print my list called text:
print(text)
the return will show something like
[['this', 'example', '',], ['a','b','']]
How do i remove the empty strings from here?
if i print my list called text:
print(text)
the return will show something like
[['this', 'example', '',], ['a','b','']]
How do i remove the empty strings from here?
With a list comprehension:
text = [['this', 'example', '',], ['a','b','']]
print([[string for string in sublist if string] for sublist in text])
# [['this', 'example'], ['a', 'b']]