J
J
Johnem2020-04-28 20:39:16
Python
Johnem, 2020-04-28 20:39:16

How to remove an empty list in a list?

That is, from this [[], "sgsegs", []]
make ["sgsegs"]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-04-28
@Johnem

a = [[], "sgsegs", []]
b = [i for i in a if i]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question