toc Builtin
Firmware & API Reference > MicroPython Modules > Builtin

Builtin

All builtin functions are described here.

abs(val)

Returns the absolute value of val

all(itereable)

Returns true if all items in an iterable are value True

any(iterable)

Returns true if any of the items in an iterable are value True

bin(val)

Returns the binary equivalent of the given integer

bytearray([source, encoding, errors])

Returns the bytearray of the bytes array passed in

bytes()

Similar to bytearray() but for a single byte

callable(object)

Returns True if the object appears callable

chr(val)

Returns a character from an integer

classmethod(foo)

Returns a classmethod for the passed function

complex([real, imag])

Creates a complex number from the passed variables.

You can also use the textual notation 'a+bj', e.g. '1+2j'

delattr(object, name)

Deletes attribute from the object.

dir([object])

Returns a list of valid attributes of the object. If no parameter is passed, it will return all created objects.

divmod(x, y)

Divides and mods the two values. Similar to (x / y, x % y)
Returns a tuple (q, r) of the two paramters, with quotient q and remainder r

numerate()

eval()

exec()

filter()

class float

class frozenset

getattr()

globals()

hasattr()

hash()

hex()

id()

input()

class int

isinstance()

issubclass()

iter()

len()

class list

locals()

map()

max()

class memoryview

min()

next()

class object

oct()

open()

ord()

pow()

print()

property()

range()

repr()

reversed()

round()

class set

setattr()

sorted()

staticmethod()

class str

sum()

super()

class tuple

type()

zip()

 

Previous Next