Menu

Menu

Sunday, 8 April 2018

what means any and all in python?

In python any is used for OR operation.If any of the item is true then returns true.

And all represent AND if all of the item is true then returns true.

example:                                           


 >>> any([True,True])
True
>>> any([True,False])
True                          

Example for all operation: 
>> all([True,True])
True
>>> all([True,False])
False
>>> all([False,False])
False

No comments:

Post a Comment