All() method in Python Built in Function
all method in built function returns the absolute value as TRUE only if all the items are true in the argument or else the output will be FALSE of a given number in the program.
Syntax:
all(iterable)
Table of ‘all’ method
| When | Value |
| All values are true | True |
| All values are false | False |
| Only one value is True | False |
| Only one value is False | False |
| Only Iterable | True |
Example-1:
When all values are TRUE
text = [True, True, True, 'True'] x = all(text) print(x)
Output:
Example-2:
When all values are FALSE
text = [False, False, False] x = all(text) print(x)
Output:
Example-3:
When only one value is TRUE
text = [False, True, False] x = all(text) print(x)
Output:
Example-4
When only one value is FALSE
text = [True, False, True] x = all(text) print(x)
Output:
Example-5:
When the iterable is empty
text = [] x = all(text) print(x)
Output:
