Copyright (c) Hyperion Entertainment and contributors.
AmigaOS Manual: Python Functions: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
| Line 94: | Line 94: | ||
== property == |
== property == |
||
== range == |
== range == |
||
== repr == |
== repr() == |
||
== reversed == |
== reversed == |
||
== round == |
== round == |
||
Revision as of 12:57, 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
ascii()
ascii(object)
As repr(), return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by repr() using \x, \u or \U escapes. This generates a string similar to that returned by repr() in Python 2.