Built-in Functions in Python

The following table will show you built-in functions in python programming language.

Built-in Functions

abs() divmod() input() open()
staticmethod() all() enumerate() int()
ord() str() any() eval()
isinstance() pow() sum() basestring()
execfile() issubclass() print() super()
bin() file() iter() property()
tuple() bool() filter() len()
range() type() bytearray() float()
list() raw_input() unichr() callable()
format() locals() reduce() unicode()
chr() frozenset() long() reload()
vars() classmethod() getattr() map()
repr() xrange() cmp() globals()
max() reversed() zip() compile()
hasattr() memoryview() round() __import__()
complex() hash() min() set()
delattr() help() next() setattr()
dict() hex() object() slice()
dir() id() oct() sorted()

Most Used Function

Function Description
abs(number) Returns the absolute value of a number.
cmath.sqrt(number) Returns the square root; works with negative numbers.
float(object) Converts a string or number to a floating-point number.
help() Offers interactive help.
input(prompt) Gets input from the user.
int(object) Converts a string or number to an integer.
long(object) Converts a string or number to a long integer.
math.ceil(number) Returns the ceiling of a number as a float.
math.floor(number) Returns the floor of a number as a float.
math.sqrt(number) Returns the square root; doesn't work with negative numbers.
pow(x, y[, z]) Returns x to the power of y (modulo z).
raw_input(prompt) Gets input from the user, as a string.
repr(object) Returns a string representation of a value.
round(number[,ndigits]) Rounds a number to a given precision.
str(object) Converts a value to a string.

Most used functions in Arrays

Function Description
cmp(x, y) Compares two values.
len(seq) Returns the length of a sequence.
list(seq) Converts a sequence to a list.
max(args) Returns the maximum of a sequence or set of arguments.
min(args) Returns the minimum of a sequence or set of arguments.
reversed(seq) Lets you iterate over a sequence in reverse.
sorted(seq) Returns a sorted list of the elements of seq.
tuple(seq) Converts a sequence to a tuple.