Python all() function


(Sponsors) Get started learning Python with DataCamp's free Intro to Python tutorial. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. Start Now!


The all() function tests whether all items in the iterable evaluates to True or not. It accepts an iterable and returns True if all the item is true, otherwise, it returns False.

Its syntax is as follows:

Here is an example:

 


Other Tutorials (Sponsors)

This site generously supported by DataCamp. DataCamp offers online interactive Python Tutorials for Data Science. Join over a million other learners and get started learning Python for data science today!


Leave a Reply

Your email address will not be published. Required fields are marked *