Tag: Python: Check if dictionary is empty
Python: Check if dictionary is empty
In this article we will discuss different ways to check if a dictionary is empty or not. These two ways to check if a python dictionary is empty or not, By casting dictionary to bool in if statement. Using len() function. Suppose we have two dictionaries: The first dictionary contains strings as keys and integers …