Function any (Example Python Built-in Functions)

Comments   0   Date Arrow  November 3, 2008 at 10:55am   User  by pichai

any(iterable)
จะคืนค่า True ถ้าแต่ละ elements ใน iterable เป็น True อย่างน้อย 1 ตัว
>>> a = [True,False]
>>> any(a)
True
>>> a = [False,0]
>>> any(a)
False

Tagged   Talk  delicious  Comments  Add Your Comment