开发者社区 问答 正文

python怎么判断字典为空

python怎么判断字典为空

展开
收起
云计算小粉 2018-05-10 20:10:08 4928 分享 版权
3 条回答
写回答
取消 提交回答
  • image.png

    2019-11-14 10:16:50
    赞同 展开评论
  • MaxCompute 生态
    a = dict() if not a: print("not empty)
    2019-07-17 22:20:12
    赞同 展开评论
  • >>> a = dict() >>> if not a: ... print('The dictionary is empty') ... The dictionary is empty
    2019-07-17 22:20:12
    赞同 展开评论