Search notes:

all

all(iterable) evaluates to True if all elements of iterable are True, and to False otherwise.
print( all( [] ))
#
#  True

print( all( [False] ))
#
#  False

print( all( [False, True] ))
#
#  False

print( all( [True, True] ))
#
#  True
Github repository about-python, path: /builtin-functions/all/simple.py
a = ['foo', 'bar', 'baz']


if all(word in ['foo', 'bar'] for word in a):
   print("yes")
else:
   print("no")
#
#  no



if all(word in ['foo', 'bar', 'baz'] for word in a):
   print("yes")
else:
   print("no")
#
#  yes



if all(word in ['foo', 'bar', 'baz', 'loch-ness'] for word in a):
   print("yes")
else:
   print("no")
#  
#  yes
Github repository about-python, path: /builtin-functions/all/more-complex.py

See also

any()
Python: Built in functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199136, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/built-in-functions/all(89): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78