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!
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!
any() gives false for an empty list and true for iterable elements in list
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