How to check if a dictionary is empty in Python

Опубликовано: 24 Июль 2026
на канале: Enthought
2,469
11

In this short tutorial, you will learn how to check if a dictionary is empty in Python using the boolean interpretation of containers. Want to learn more? See our Python classes at https://goo.gl/UumTma.

Read the documentation for dictionaries here: https://docs.python.org/3/library/std...

Code from video:
*****************
data = {}
if not data: print('empty')

Connect with us!
*****************
  / enthought  
  / enthought  
  / enthought