Built-in Functions



print(object = ‘’, end = "\n")
Print
object
to stdout followed by
end
.

input([prompt])
If the
prompt
argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that.

assert(expression, message = ‘’)
Raise AssertionError if
expression
evaluates to false.

exit(message = N)
Terminates the calling process. When
message
is specified it is printed to stderr.

sleep(secs)
Suspend execution of the calling thread for the given number of seconds. The argument may be a floating point number to indicate a more precise sleep time.

swap(&a, &b)
Exchanges the values of the two arguments. Equivalent to
(a, b) = (b, a)
.

zip(iterable1, iterable2 [,iterable3])
Aggregates elements from input iterables.

all(iterable)
Return true (1B) if all elements of the
iterable
are true (or if the
iterable
is empty).

any(iterable)
Return true (1B) if any element of the
iterable
is true. If the
iterable
is empty, return false (0B).

cart_product(iterable1, iterable2 [,iterable3])
Cartesian product of input iterables.

multiloop(iterable1, iterable2 [,iterable3], function)
This function is roughly equivalent to the following code: {}

multiloop_filtered(iterable1, iterable2 [,iterable3], filter_function, function)
This function is roughly equivalent to the following code: {}

sum(iterable)
Sums the items of an
iterable
and returns the total.

product(iterable)
Multiplies the items of an
iterable
and returns the total.

sorted(iterable, key = N, reverse = 0B)
Return a new sorted array from the items in
iterable
.
key
specifies a function of one argument that is used to extract a comparison key from each element of
iterable
.
reverse
is a boolean value. If set to true (1B), then the elements of
iterable
are sorted as if each comparison were reversed.

min(arg1, arg2)
Return the smallest of two arguments.
min(iterable)
Return the smallest item of
iterable
.

max(arg1, arg2)
Return the largest of two arguments.
max(iterable)
Return the largest item of
iterable
.

hex(x)
Convert an integer number to an uppercase hexadecimal string.

bin(x)
Convert an integer number to a binary string.

rotl(value, shift)
Rotate the
value
left by
shift
bits.

rotr(value, shift)
Rotate the
value
right by
shift
bits.

Mathematical functions