Python Program to Check If a List is Empty (Using Boolean operation)

bookmark

my_list = []
if not my_list:
    print("the list is empty")

 

Output

the list is empty