Answers for "how to check list is empty or not"

0

how to check list is empty or not

l1 = ["Hire", "the", "top", "1%", "freelancers"]

l2 = []

if l2:
    print("list is not empty")
else:
    print("list is empty")

#Output: "list is empty"
Posted by: Guest on February-27-2022

Code answers related to "how to check list is empty or not"

Python Answers by Framework

Browse Popular Code Answers by Language