python 判断字典是否为空

 

my_dict = {}  
  
if not bool(my_dict):  
    print("Dictionary is empty")

 

posted @ 2018-11-19 10:12  anobscureretreat  阅读(25560)  评论(0)    收藏  举报