# Python: Check if a List Is Empty (Pythonic Way)

> Test whether a Python list is empty using the idiomatic `if not my_list` check recommended by PEP-8, the official Python style guide, shown with a working example

**URL:** https://sentry.io/answers/check-if-a-list-is-empty-in-python/

---

## The Problem

How do I check if a list is empty in Python?

## The Solution

[The Python style guide, PEP-8, recommends](https://peps.python.org/pep-0008/#programming-recommendations) checking whether a list (or other sequence) is `False` to determine that it is empty. For example:

```python
empty_list = []

if not empty_list:
    print("The list is empty.")
```

---

*Source: [sentry.io/answers/check-if-a-list-is-empty-in-python/](https://sentry.io/answers/check-if-a-list-is-empty-in-python/)*
