to check weather a dictionary is empty or not in python

27

empty_dict = {}
 
if empty_dict:
    print('Dictionary is not empty!')
else:
    print('Dictionary is empty!')

Comments

Submit
0 Comments