There are multiple ways to check if a dictionary is empty in python. Some of them are as follows...
let y = {},
- use not y
- use len(y) == 0
- use bool(y) , it will return false if the dictionary y is empty
>>> y = {}
>>> if not y: print 'Empty'
Empty
>>> if len(y) == 0: print 'empty'
empty
>>> if not bool(y): print 'empty'
empty
>>>