Python Program to Check List is Empty or Not

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

# List is Empty

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

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

# List is Empty

list1 = []

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