描述
any() 函数用于判断给定的可迭代参云计数 iterable 是否全部为 False,则返算开回 False,如果有一个为 True,则返发:回 True。
元素除了是 0、空、FALSE 外都算Py TRUE。
函数等价于:
Python 2.5 以上版th本可用。
语法
以下是 any() 方法的语法:
anyon(iterable)
参数
iterable -- 元组或内置列表。
返回值
如果都为空、0、false,则返回fa函数lse,如果不都为空、0、false,则返回t-arue。
实例
以下展示了使用 any() 方法的实例:
作者:数字化转型




.gif)
.gif)
.gif)
.gif)
.gif)
.gif)
.gif)
.gif)
.gif)
.gif)



