Members
- abs
- all
- any
- bool
- dict
- dir
- enumerate
- fail
- float
- getattr
- hasattr
- hash
- int
- len
- list
- max
- min
- range
- repr
- reversed
- set
- sorted
- str
- tuple
- type
- zip
abs
Parameters
all
Parameters
any
Parameters
bool
False if the object is None, False, an empty string (""), the number 0, or an empty collection (e.g. (), []). Otherwise, it returns True.
Parameters
dict
Parameters
dir
Parameters
enumerate
Parameters
fail
Parameters
float
- If
xis already a float,floatreturns it unchanged.* Ifxis a bool,floatreturns 1.0 for True and 0.0 for False.* Ifxis an int,floatreturns the nearest finite floating-point value to x, or an error if the magnitude is too large.* Ifxis a string, it must be a valid floating-point literal, or be equal (ignoring case) toNaN,Inf, orInfinity, optionally preceded by a+or-sign.
float() returns 0.0.
Parameters
getattr
default (if specified) or raises an error. getattr(x, "foobar") is equivalent to x.foobar.
Parameters
hasattr
x has an attribute or method of the given name, otherwise False. Example:
Parameters
hash
String.hashCode(), namely:
Parameters
int
- If
xis already an int,intreturns it unchanged.* Ifxis a bool,intreturns 1 for True and 0 for False.* Ifxis a string, it must have the format<sign><prefix><digits>.<sign>is either"+","-", or empty (interpreted as positive).<digits>are a sequence of digits from 0 up tobase- 1, where the letters a-z (or equivalently, A-Z) are used as digits for 10-35. In the case wherebaseis 2/8/16,<prefix>is optional and may be 0b/0o/0x (or equivalently, 0B/0O/0X) respectively; if thebaseis any other value besides these bases or the special value 0, the prefix must be empty. In the case wherebaseis 0, the string is interpreted as an integer literal, in the sense that one of the bases 2/8/10/16 is chosen depending on which prefix if any is used. Ifbaseis 0, no prefix is used, and there is more than one digit, the leading digit cannot be 0; this is to avoid confusion between octal and decimal. The magnitude of the number represented by the string must be within the allowed range for the int type.* Ifxis a float,intreturns the integer value of the float, rounding towards zero. It is an error if x is non-finite (NaN or infinity).
x is any other type, or if the value is a string not satisfying the above format. Unlike Python’s int function, this function does not allow zero arguments, and does not allow extraneous whitespace for string arguments.
Examples:
Parameters
len
Parameters
list
Parameters
max
Parameters
min
Parameters
args as debug output. It will be prefixed with the string "DEBUG" and the location (file and line number) of this call. The exact way in which the arguments are converted to strings is unspecified and may change at any time. In particular, it may be different from (and more detailed than) the formatting done by str() and repr().
Using print in production code is discouraged due to the spam it creates for users. For deprecations, prefer a hard error using fail() whenever possible.
Parameters
range
start to stop, using a step increment. If a single argument is provided, items will range from 0 to that element.
Parameters
repr
Parameters
reversed
Parameters
set
set() returns a new empty set.
For example,
Parameters
sorted
Parameters
str
Parameters
tuple
Parameters
type
Parameters
zip
list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The list has the size of the shortest input. With a single iterable argument, it returns a list of 1-tuples. With no arguments, it returns an empty list. Examples: