当前位置:主页 > 软件编程 > Python代码 >
时间:2021-05-02 08:18:43 | 栏目:Python代码 | 点击:次
Test
tuple_test = () assert not tuple_test list_test = [] assert not list_test dict_test = {} assert not dict_test
Summary
根据实验结果可知,直接通过:
if not xxx:
即可判断 tuple、list、dict 是否 为空 。