Python的任意函数和所有函数是如何工作的?
any()
all()
True
False
d
defaultdict(list)
.
print d['Drd2']# [[1, 5, 0], [1, 6, 0]]print list(zip(*d['Drd2']))# [(1, 1), (5, 6), (0, 0)]print [any(x) and not all(x) for x in zip(*d['Drd2'])]# [False, False, False]
# [False, True, False]
为什么对所有的元组都要评估为false?
Helenr
呼唤远方
相关分类