> all returns True if all elements in something list-like (such as a list or tuple) are “truthy.” If any element is false or if the list is empty, it returns False.
Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> all([])
True
To be honest I hate searching for docs on built-in Python functions. The reference is actually hard to navigate and it seems to spread this information out. Thanks for this.
[+] [-] smarx007|1 year ago|reply
This is The ultimate clickbait. Bravo!
[+] [-] extraduder_ire|1 year ago|reply
[+] [-] maw|1 year ago|reply
[+] [-] throw_a_grenade|1 year ago|reply
> all returns True if all elements in something list-like (such as a list or tuple) are “truthy.” If any element is false or if the list is empty, it returns False.
[+] [-] budafish|1 year ago|reply
> all([]) returns True since the iterable is empty.
[+] [-] wakawaka28|1 year ago|reply
[+] [-] zt1123G|1 year ago|reply
[+] [-] fuzztester|1 year ago|reply
[+] [-] rednafi|1 year ago|reply
[+] [-] rednafi|1 year ago|reply
[+] [-] unknown|1 year ago|reply
[deleted]