Python 内建函数 - all(iterable)

    xiaoxiao2021-03-25  57

    Manual直译实例

    Manual

    Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to:

    def all(iterable): for element in iterable: if not element: return False return True

    直译

    如果序列所有元素为真或空序列则返回True。

    实例

    >>> all([ ]) True >>> all(( )) True >>> all({ }) True >>> all(' ') True >>> all([False]) False >>> all(['False']) True >>> all(['What the fuck!']) True
    转载请注明原文地址: https://ju.6miu.com/read-39048.html

    最新回复(0)