Python Built-in Functions

Python provides a comprehensive set of built-in functions that can be used to perform various tasks. These functions are always available and do not require any imports to use them. Below is a list of some commonly used built-in functions, along with their descriptions and links to detailed guides for each function.

Python Built-in Functions Table

Function Description
abs() Returns the absolute value of a number.
all() Returns True if all elements of an iterable are true.
any() Returns True if any element of an iterable is true.
ascii() Returns a string containing a printable representation of an object.
bin() Converts an integer to a binary string.
bool() Converts a value to a Boolean.
bytearray() Returns a byte array object.
bytes() Returns a bytes object.
callable() Returns True if the object appears callable.
chr() Returns a string representing a character from an integer.
classmethod() Converts a method into a class method.
compile() Compiles source into a code or AST object.
complex() Returns a complex number.
delattr() Deletes an attribute from an object.
dict() Creates a dictionary.
dir() Tries to return a list of valid attributes of an object.
divmod() Returns a tuple containing the quotient and remainder when dividing two numbers.
enumerate() Returns an enumerate object.
eval() Evaluates a given expression.
exec() Executes the given code.
filter() Constructs an iterator from elements of an iterable for which a function returns true.
float() Returns a floating-point number.
format() Formats a specified value.
frozenset() Returns a frozenset object.
getattr() Returns the value of the named attribute of an object.
globals() Returns a dictionary representing the current global symbol table.
hasattr() Returns True if the object has the specified attribute.
hash() Returns the hash value of an object.
help() Invokes the built-in help system.
hex() Converts an integer to a hexadecimal string.
id() Returns the identity of an object.
input() Reads a line from input.
int() Converts a value to an integer.
isinstance() Checks if an object is an instance of a class.
issubclass() Checks if a class is a subclass of another class.
iter() Returns an iterator object.
len() Returns the length of an object.
list() Creates a list.
locals() Updates and returns a dictionary representing the current local symbol table.
map() Applies a function to every item of an iterable.
max() Returns the largest item in an iterable or the largest of two or more arguments.
memoryview() Returns a memory view object.
min() Returns the smallest item in an iterable or the smallest of two or more arguments.
next() Retrieves the next item from an iterator.
object() Returns a new featureless object.
oct() Converts an integer to an octal string.
open() Opens a file and returns a corresponding file object.
ord() Converts a character to its Unicode code.
print() Prints to the standard output device.
property() Returns a property attribute.
range() Returns a sequence of numbers.
reversed() Returns a reversed iterator.
round() Rounds a number to a specified number of digits.
set() Creates a set.
setattr() Sets the value of the specified attribute of an object.
slice() Returns a slice object.
staticmethod() Converts a method into a static method.
str() Returns a string version of an object.
sum() Sums the items of an iterable.
super() Returns a proxy object that delegates method calls to a parent or sibling class.
tuple() Creates a tuple.
type() Returns the type of an object.
vars() Returns the dict attribute of an object.
zip() Returns an iterator of tuples.
import() Invoked by the import statement.

For more detailed information on each function, refer to the official Python documentation.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top