Built-in functions in Python

Built-in functions in Python

Built-in Function Description

abs()

It is used to return the absolute value of a number.

all()

It returns True if all elements of the iterable are true (or if the iterable is empty).

any()

It returns True if any element of the iterable is true. If the iterable is empty, return False.

ascii()

Return a string containing a printable representation of an object, but escape the non-ASCII characters.

bin()

It converts an integer number to a binary string.

bool()

It converts a value to a Boolean.

bytearray()

It returns a new array of bytes.

bytes()

It returns a new “bytes” object.

callable()

It returns True if the object argument appears callable, False if not.

chr()

It returns the string representing a character.

classmethod()

It returns a class method for the function.

compile()

Used to Compile the source into a code or AST object.

complex()

Create a complex number or convert a string or number to a complex number.

delattr()

Deletes the named attribute of an object.

dict()

Create a new dictionary.

dir()

Return the list of names in the current local scope.

divmod()

Return a pair of numbers consisting of quotient and remainder when using integer division.

enumerate()

Return an enumerate object.

eval()

The argument is parsed and evaluated as a Python expression.

exec()

Dynamic execution of Python code.

filter()

Construct an iterator from elements of iterable for which function returns true.

float()

Convert a string or a number to floating point.

format()

Convert a value to a “formatted” representation.

frozenset()

Return a new frozenset object.

getattr()

Return the value of the named attribute of an object.

globals()

Return a dictionary representing the current global symbol table.

hasattr()

Return True if the name is one of the object’s attributes.

hash()

Return the hash value of the object.

help()

Invoke the built-in help system.

hex()

Convert an integer number to a hexadecimal string.

id()

Return the “identity” of an object.

input()

Reads a line from input, converts it to a string (stripping a trailing newline), and returns that.

int()

Convert a number or string to an integer.

isinstance()

Return True if the object argument is an instance.

issubclass()

Return True if class is a subclass.

iter()

Return an iterator object.

len()

Return the length (the number of items) of an object.

list()

Return a list.

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.

memoryview()

Return a “memory view” object created from the given argument.

min()

Return the smallest item in an iterable.

next()

Retrieve the next item from the iterator.

object()

Return a new featureless object.

oct()

Convert an integer number to an octal string.

open()

Open file and return a corresponding file object.

ord()

Return an integer representing the Unicode.

pow()

Return power raised to a number.

print()

Print objects to the stream.

property()

Return a property attribute.

range()

Return an iterable sequence.

repr()

Return a string containing a printable representation of an object.

reversed()

Return a reverse iterator.

round()

Return the rounded floating point value.

set()

Return a new set object.

setattr()

Assigns the value to the attribute.

slice()

Return a slice object.

sorted()

It is used to return a new sorted list.

staticmethod()

It return a static method for function.

str()

It returns a str version of object.

sum()

Sums 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.

tuple()

It returns a tuple

type()

type() returns the type of an object.

vars()

This function returns the __dict__ attribute for a module, class, instance, or any other object.

zip()

Make an iterator that aggregates elements from each of the iterables.

__import__()

 Import statement is used to invoke this function.

SEE the detail explanation  about built-in function in Python 3 at python official site.

Learn basic of Function in Python here


Next Tutorial:

Python File Handling

 

Leave a Reply