python – check if list is empty

In this post, we will see how to check if list is empty in python.
It is very easy to check if list is empty in python. You can use "not" to check if list is empty in Python.
Let’s understand with the help of simple example.

Output:

list1 is not empty
list2 is empty

You can also use Python len function to check if list is empty or not.

💻 Awesome Tech Resources:
  • Looking for ⚒️ tech jobs? Go to our job portal.
  • Looking for tech events? Go to tech events 🗓️ Calendar.️

Output:

list3 is empty
list4 is not empty

That’s all about python check if list is empty.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.