oursolutionarchitectoursolutionarchitect
  • Python Questions and Answers
  • Python - Programming Examples
  • Python - Quick Guide
  • Python - Useful Resources
  • Python - Discussion
    • Selected Reading
    • Q&A

    Python - Built-in Functions


    Built-in Functions — Python 3.12.2

    As of Python 3.12.2 version, there are 71 built-in functions. The list of built-in functions is given below −

    Sr.No. Function & Description

    1

    abs()

    Returns absolute value of a number

    2

    aiter()

    Returns an asynchronous iterator for an asynchronous iterable

    3

    all()

    Returns true when all elements in iterable is true

    4

    anext()

    Returns the next item from the given asynchronous iterator

    5

    any()

    Checks if any Element of an Iterable is True

    6

    ascii()

    Returns String Containing Printable Representation

    7

    bin()

    Converts integer to binary string

    8

    bool()

    Converts a Value to Boolean

    9

    breakpoint()

    This function drops you into the debugger at the call site and calls sys.breakpointhook()

    10

    bytearray()

    returns array of given byte size

    11

    bytes()

    returns immutable bytes object

    12

    callable()

    Checks if the Object is Callable

    13

    chr()

    Returns a Character (a string) from an Integer

    14

    classmethod()

    Returns class method for given function

    15

    compile()

    Returns a code object

    16

    complex()

    Creates a Complex Number

    17

    delattr()

    Deletes Attribute From the Object

    18

    dict()

    Creates a Dictionary

    19

    dir()

    Tries to Return Attributes of Object

    20

    divmod()

    Returns a Tuple of Quotient and Remainder

    21

    enumerate()

    Returns an Enumerate Object

    22

    eval()

    Runs Code Within Program

    23

    exec()

    Executes Dynamically Created Program

    24

    filter()

    Constructs iterator from elements which are true

    25

    float()

    Returns floating point number from number, string

    26

    format()

    Returns formatted representation of a value

    27

    frozenset()

    Returns immutable frozenset object

    28

    getattr()

    Returns value of named attribute of an object

    29

    globals()

    Returns dictionary of current global symbol table

    30

    hasattr()

    Returns whether object has named attribute

    31

    hash()

    Returns hash value of an object

    32

    help()

    Invokes the built-in Help System

    33

    hex()

    Converts to Integer to Hexadecimal

    34

    id()

    Returns Identify of an Object

    35

    input()

    Reads and returns a line of string

    36

    int()

    Returns integer from a number or string

    37

    isinstance()

    Checks if a Object is an Instance of Class

    38

    issubclass()

    Checks if a Class is Subclass of another Class

    39

    iter()

    Returns an iterator

    40

    len()

    Returns Length of an Object

    41

    list()

    Creates a list in Python

    42

    locals()

    Returns dictionary of a current local symbol table

    43

    map()

    Applies Function and Returns a List

    44

    max()

    Returns the largest item

    45

    memoryview()

    Returns memory view of an argument

    46

    min()

    Returns the smallest value

    47

    next()

    Retrieves next item from the iterator

    48

    object()

    Creates a featureless object

    49

    oct()

    Returns the octal representation of an integer

    50

    open()

    Returns a file object

    51

    ord()

    Returns an integer of the Unicode character

    52

    pow()

    Returns the power of a number

    53

    print()

    Prints the Given Object

    54

    property()

    Returns the property attribute

    55

    range()

    Returns a sequence of integers

    56

    repr()

    Returns a printable representation of the object

    57

    reversed()

    Returns the reversed iterator of a sequence

    58

    round()

    Rounds a number to specified decimals

    59

    set()

    Constructs and returns a set

    60

    setattr()

    Sets the value of an attribute of an object

    61

    slice()

    Returns a slice object

    62

    sorted()

    Returns a sorted list from the given iterable

    63

    staticmethod()

    Transforms a method into a static method

    64

    str()

    Returns the string version of the object

    65

    sum()

    Adds items of an Iterable

    66

    super()

    Returns a proxy object of the base class

    67

    tuple()

    Returns a tuple

    68

    type()

    Returns the type of the object

    69

    vars()

    Returns the __dict__ attribute

    70

    zip()

    Returns an iterator of tuples

    71

    __import__()

    Function called by the import statement

    Built-in Mathematical Functions

    Following mathematical functions are built into the Python interpreter, hence you don't need to import them from any module.

    Sr.No. Function & Description

    1

    Python abs() function

    The abs() function returns the absolute value of x, i.e. the positive distance between x and zero.

    2

    Python max() function

    The max() function returns the largest of its arguments or largest number from the iterable (list or tuple).

    3

    Python min() function

    The function min() returns the smallest of its arguments i.e. the value closest to negative infinity, or smallest number from the iterable (list or tuple)

    4

    Python pow() function

    The pow() function returns x raised to y. It is equivalent to x**y. The function has third optional argument mod. If given, it returns (x**y) % mod value

    5

    Python round() Function

    round() is a built-in function in Python. It returns x rounded to n digits from the decimal point.

    6

    Python sum() function

    The sum() function returns the sum of all numeric items in any iterable (list or tuple). An optional start argument is 0 by default. If given, the numbers in the list are added to start value.