Answers for "python check if object is empty"

0

python check if object is empty

dict1 = {}

if dict1:
    print("dict1 Not Empty")
else:
    print("dict1 is Empty")

if bool(dict1):
    print("dict1 Not Empty")
else:
    print("dict1 is Empty")
Posted by: Guest on February-20-2022

Code answers related to "python check if object is empty"

Python Answers by Framework

Browse Popular Code Answers by Language