I am trying to check if a dictionary is empty but it doesn\'t behave properly. It just skips it and displays ONLINE without anything except of display the m
Simple ways to check an empty dict are below:
a= {} 1. if a == {}: print ('empty dict') 2. if not a: print ('empty dict')
Although method 1st is more strict as when a = None, method 1 will provide correct result but method 2 will give an incorrect result.