Python trick for the day!

:mega: Hello Student!
Did you ever explore Python’s any() and all() functions?
Write a Python script to explain the usability of these two functions.

Happy Learning!

1 Like

any() gives false for an empty list and true for iterable elements in list

1 Like

Simply words,
any() functions display result as True if at least one value of arguments is non-zero or True; whereas
all() function display result as True only if all values of arguments is non-zero/True or value must be empty

1 Like