1test_dict = {}
2
3if not test_dict:
4 print "Dict is Empty"
5
6
7if not bool(test_dict):
8 print "Dict is Empty"
9
10
11if len(test_dict) == 0:
12 print "Dict is Empty"
1# Using the not operator, Check if dictionary is empty
2
3test_dict = {}
4res = not test_dict
5print("Is dictionary empty ? : " + str(res))
6
7# Output :
8# Is dictionary empty ? : True