python 如何判断字典是否为空?

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Dongfnag_HU/article/details/85048373

在python里,{},[],(),等都等价于False!

if dict:
    print 'not Empty'

猜你喜欢

转载自blog.csdn.net/Dongfnag_HU/article/details/85048373