You are here : python_3 -> Built-in Functions

Built-in Functions

abs() Return the absolute value of a number.
all() Return True if all elements of the iterable are true (or if the iterable is empty)
any() Return True if any element of the iterable is true
ascii() 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
bin() Convert an integer number to a binary string
callable() Return True if the object argument appears callable, False if not
chr() Return the string representing a character whose Unicode code point is the integer i
classmethod() Return a class method for function
compile() Compile the source into a code or AST object
delattr() This is a relative of setattr()
dir() Without arguments, return the list of names in the current local scope
divmod() Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division
enumerate() Return an enumerate object
eval() The arguments are a string and optional globals and locals
exec() This function supports dynamic execution of Python code
filter() Construct an iterator from those elements of iterable for which function returns true
format() Convert a value to a “formatted” representation, as controlled by format_spec
getattr() Return the value of the named attribute of object
globals() Return a dictionary representing the current global symbol table
hasattr() The arguments are an object and a string
hash() Note
help() Invoke the built-in help system
hex() Convert an integer number to a lowercase hexadecimal string prefixed with “0x”, for example:
id() Return the “identity” of an object
input() If the prompt argument is present, it is written to standard output without a trailing newline
isinstance() Return true if the object argument is an instance of the classinfo argument, or of a (direct, indirect or virtual) subclass thereof
issubclass() Return true if class is a subclass (direct, indirect or virtual) of classinfo
iter() Return an iterator object
len() Return the length (the number of items) of an object
locals() Update and return a dictionary representing the current local symbol table
map() Return an iterator that applies function to every item of iterable, yielding the results
max() Return the largest item in an iterable or the largest of two or more arguments
memoryview() Return a “memory view” object created from the given argument
min() Return the smallest item in an iterable or the smallest of two or more arguments
next() Retrieve the next item from the iterator by calling its __next__() method
oct() Convert an integer number to an octal string
open() Open file and return a corresponding file object
ord() Given a string representing one Unicode character, return an integer representing the Unicode code point of that character
pow() Return x to the power y; if z is present, return x to the power y, modulo z (computed more efficiently than pow(x, y) % z)
print() Print objects to the text stream file, separated by sep and followed by end
range() Rather than being a function, range is actually an immutable sequence type, as documented in Ranges and Sequence Types — list, tuple, range
repr() Return a string containing a printable representation of an object
reversed() Return a reverse iterator
round() Return the floating point value number rounded to ndigits digits after the decimal point
setattr() This is the counterpart of getattr()
sorted() Return a new sorted list from the items in iterable
staticmethod() Return a static method for function
sum() Sums start and the items of an iterable from left to right and returns the total
super() Return a proxy object that delegates method calls to a parent or sibling class of type
tuple() Rather than being a function, tuple is actually an immutable sequence type, as documented in Tuples and Sequence Types — list, tuple, range
vars() Return the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute
zip() Make an iterator that aggregates elements from each of the iterables
__import__() Note