python3判断列表为空

版权声明:学习分享,共同进步 https://blog.csdn.net/Andrew_jdw/article/details/82664908
a = []
if a:
    print("this list is not null")
else:
    print("this list is null")

运行结果如下: 

猜你喜欢

转载自blog.csdn.net/Andrew_jdw/article/details/82664908