In this code snippet, we’ll show an example to check How to check if a list (array) is empty using Boolean true or false in Python.

How to check if a list (array) is empty using Boolean true or false in Python

x = []
not x # True

y = [1, 2]
not y # False

CC BY 4.0 added intro and tags – 30 Seconds of Code

Tags: python, python list, list, empty, false, true, bool