Reputation: 183
I have this list :
a = [[], [], []]
and that one :
b = [[], [2], []]
I would like to check if a and b are empty. I mean for me a is empty and b is not. How can I do that ?
Thank you very much !
Upvotes: 0
Views: 68
Reputation: 117866
You could check for "empty" using not any
>>> not any(a)
True
>>> not any(b)
False
Upvotes: 1