if list is not empty python
# The least verbose answer is:
# if a is a data structure, then
# "not a" will evaluate to True if a is empty.
# This is a more explicit example
# for a deque data structure (could be any other data structure)
dq = deque()
empty_dq = deque()
dq.append(1) # dq now contains 1 element
if dq == empty_dq:
print("Empty.")
else:
print("Not empty.")