Copyright (c) Hyperion Entertainment and contributors.
AmigaOS Manual: Python Functions: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
| Line 23: | Line 23: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
== any == |
== any() == |
||
<nowiki>any(iterable)</nowiki> |
|||
Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to: |
|||
<syntaxhighlight lang="python"> |
|||
def any(iterable): |
|||
for element in iterable: |
|||
if element: |
|||
return True |
|||
return False |
|||
</syntaxhighlight> |
|||
== ascii == |
== ascii == |
||
== bin == |
== bin == |
||
Revision as of 12:54, 15 July 2018
Built-in Functions Reference
__import__
abs()
abs(number)
Return the absolute value of a number. The argument may be an integer or a floating point number. If the argument is a complex number, its magnitude is returned.
all()
all(iterable)
Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to:
def all(iterable):
for element in iterable:
if not element:
return False
return True
any()
any(iterable)
Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to:
def any(iterable):
for element in iterable:
if element:
return True
return False