In Python, I know that the pythonic method to check for an empty list is
if not a:
To check if the list is empty, we would do:
if a:
How will we check at the same time (as read) if the two lists are not empty?
if a and b:
The above doesn't work, and I'm not sure what (a and b) means. For a = [2] , b = [1,3] , (a and b) = [1,3] . What does the and operator really do? If I eventually reduce b = [] , (a and b) = [] , although a not empty.
Edit: my usage example looks something like
while (a and b are not empty): modify a modify b
I would naively think that since if a checks if the list is empty, if a and b will check if they were empty, which is not the case.
source share