-2

Assuming have m different boolean variables, c1, c2,..cm. How to evaluate whether all of them are true, or any one of these elements is not true, etc. It can be very efficient to check them one by one.

user288609
  • 12,465
  • 26
  • 85
  • 127
  • 2
    Does this answer your question? [How to check if all elements of a list matches a condition?](https://stackoverflow.com/questions/10666163/how-to-check-if-all-elements-of-a-list-matches-a-condition) – Brian61354270 Apr 16 '21 at 16:48

1 Answers1

0

Use any and all:

c = [True, False]

print(any(c))
# True

print(all(c))
# False
Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47