Scroll Down to See All▾
absaiterallanextasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: any
Description
Returns True if any element of the iterable is true. If the iterable is empty, return False.
Extended Description
The any() function returns True if any element in the given iterable is true. If the iterable is empty, it returns False. It's equivalent to using the or operator between all elements in the iterable. The function short-circuits; it stops iterating as soon as it finds a true value.
Exceptions
- TypeError: If the argument is not iterable
Read More about any from Python Documentation
Function Signature
any(iterable: Iterable) -> bool
Module: builtins
Parameters
This function takes one parameter: iterable (an Iterable object). This can be any iterable such as a list, tuple, set, or generator.
Parameter List
- iterable: Iterable
Return
Returns a boolean value. True if any element is true, False if all are false or if the iterable is empty.
Return Type
bool
Output
Explanation
This example shows how any() behaves with different types of iterables, including an empty iterable.