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