Python Program to Check List is Empty or Not

Write a Python Program to Check whether the List is Empty or Not. We use the not operator to find the list is an empty list. 

list1 = []

if not list1:
    print("The List is Empty")
else:
    print("The List is Not Empty")
Python Program to Check List Is Empty or Not 1

We used the len function in this example that returns the list length. If list length equals zero, then it’s an empty list; Otherwise, the list is not empty.

list1 = []

if len(list1) == 0:
    print("Empty")
else:
    print("Not Empty")
Empty