Python内置函数any(iterable)可以帮助快速检查是否有bool(element)在可迭代类型中为True。>>> l = [None, False, 0]False>>> any(l)但是,Python中有没有一种优雅的方法或函数可以达到与也就是说,如果有任何bool(element) is False,<
我刚刚用下面的命令连接了两个长度不等的数组:其中,如果today orders没有值(因为todayorders数组不是那么长),则给出"none“。allorders[8])TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
那么