Hi,
How to find whether the list or dictionary is empty?.
Thanks
PSB
How to find whether the list or dictionary is empty?.
Thanks
PSB
>>> d = {}
>>> if d:
... print "d has entries"
...
>>> if not d:
... print "empty"
...
empty
>>> l = []
>>> if not l:
... print "empty list"
...
empty list
>>>
Comment