Check if all or any item in a sequence satisfies a condition in Python
You can use the all() function to check if all the items in a sequence satisfy a certain condition. Similarly, you can use the any() function to check if any of the items in a sequence satisfy a condition. Here…