Reference group
>Built-in Functions
Functions Python gives you everywhere — no import needed. 67 entries.
abs()abs(num)Returns the absolute (non-negative) value of a number or magnitude of a complex number.all()all(iterable)Check whether every item in an iterable is truthy.any()any(iterable)Check whether at least one item in an iterable is truthy.ascii()ascii(object)Return a printable representation using ASCII escape sequences.bin()bin(number)Convert an integer to a binary string.bool()bool(value=False)Convert a value to True or False.bytearray()bytearray(source=b"")Create a mutable sequence of bytes.bytes()bytes(source=b"")Create an immutable sequence of bytes.callable()callable(object)Check whether an object can be called with parentheses.chr()chr(i)Turn a Unicode number into one character.classmethod()classmethod(function)Make a method receive the class instead of an instance.compile()compile(source, filename, mode)Turn source code text into a code object.complex()complex(real=0, imag=0)Create a complex number.delattr()delattr(object, name)Delete a named attribute from an object.dict()dict(**kwargs)Create a dictionary of key-value pairs.dir()dir(object=None)List an object's available attribute names.divmod()divmod(a, b)Get a quotient and remainder together.enumerate()enumerate(iterable, start=0)Pair each item with a counter.eval()eval(source, globals=None, locals=None)Evaluate a Python expression stored as text.exec()exec(source, globals=None, locals=None)Execute Python statements stored as text.filter()filter(function, iterable)Keep items that pass a test.float()float(number=0.0)Convert a value to a decimal number.format()format(value, format_spec="")Format a value as text using a format specification.frozenset()frozenset(iterable=())Create an immutable set of unique values.getattr()getattr(object, name, default=None)Read an attribute when its name is stored in a string.globals()globals()Return the current global namespace dictionary.hasattr()hasattr(object, name)Check whether an object has a named attribute.hash()hash(object)Return an integer hash value for a hashable object.help()help(request=None)Open Python's built-in help system for a topic.hex()hex(number)Convert an integer to a hexadecimal string.id()id(object)Return an object's identity number during this run.input()input(prompt="")Read a line of text typed by a user.int()int(value=0, base=10)Convert a value to an integer.isinstance()isinstance(object, classinfo)Check whether a value is an instance of a type.issubclass()issubclass(class, classinfo)Check whether one class inherits from another.iter()iter(object, sentinel=None)Return an iterator for a collection or other iterable.len()len(object)Count the items in a collection or the characters in a string.list()list(iterable=())Make a new list from an iterable value.locals()locals()Get the local names currently available in this part of the code.map()map(function, *iterables)Apply a function to each item in one or more iterables.max()max(iterable, *, key=None, default=...)Find the largest item in an iterable.memoryview()memoryview(object)Create a view that can access binary data without copying it.min()min(iterable, *, key=None, default=...)Find the smallest item in an iterable.next()next(iterator, default=...)Get the next item from an iterator.object()object()Create a simple base object.oct()oct(integer)Convert an integer to an octal string.open()open(file, mode='r', encoding=None)Open a file so you can read from it or write to it.ord()ord(character)Get the Unicode number for one character.pow()pow(base, exp, mod=None)Raise a number to a power.print()print(*objects, sep=' ', end='\n', file=None, flush=False)Print objects to the text stream file, separated by sep and followed by end.property()property(fget=None, fset=None, fdel=None, doc=None)Create a managed attribute for a class.range()range(start, stop=None, step=1)Make a sequence of evenly spaced integers.repr()repr(object)Get a detailed string representation of a value.reversed()reversed(sequence)Get an iterator that reads a sequence backwards.round()round(number, ndigits=None)Round a number to a chosen number of digits.set()set(iterable=())Make a collection that keeps only unique items.setattr()setattr(object, name, value)Set an attribute on an object using its name as text.slice()slice(start, stop=None, step=None)Create a slice object for selecting part of a sequence.sorted()sorted(iterable, *, key=None, reverse=False)Make a new list containing items in sorted order.staticmethod()staticmethod(function)Make a method that does not receive an object or class automatically.str()str(object='')Convert a value into readable text.sum()sum(iterable, start=0)Add the items in an iterable together.super()super(type, object_or_type)Access a parent class from inside a child class.tuple()tuple(iterable=())Make a new tuple from an iterable value.type()type(object)Find out what type of value an object is.vars()vars(object=None)Get an object's attribute dictionary when it has one.zip()zip(*iterables, strict=False)Pair items from two or more iterables.
Looking for something else?
All reference groups