truc python 1

truc python

x = [True, True, False]
if any(x):
    print("Au moins un True")
if all(x):
    print("Aucun False")
if any(x) and not all(x):

Here is what the above code is Doing:
1. The any() function takes an iterable (list, string, dictionary etc.) as an argument.
2. The function returns True if any element of the iterable is True. If not, it returns False.
3. The all() function returns True when all elements in the iterable are True. If not, it returns False.

Similar Posts