python all()函数 (判断可迭代对象中是否全为True)
生活随笔
收集整理的這篇文章主要介紹了
python all()函数 (判断可迭代对象中是否全为True)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
system\python_stubs\1205152947\builtins.py
def all(*args, **kwargs): # real signature unknown"""Return True if bool(x) is True for all values x in the iterable.If the iterable is empty, return True."""pass示例:
# -*- coding: utf-8 -*- """ @File : test.py @Time : 2021/1/27 16:46 @Author : Dontla @Email : sxana@qq.com @Software: PyCharm """ print(all([2 > 1, 3 < 2, False])) # Falseprint(all([2 > 1, 3 > 2, True])) # True總結(jié)
以上是生活随笔為你收集整理的python all()函数 (判断可迭代对象中是否全为True)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: postman get post
- 下一篇: html for 循环模板