BUILT-IN FUNCTIONS
MEC301: Business Analytics Using Python
Masters in Applied Economics
Submitted by,
Medini. J.S [2339227]
3MAECO
Submitted to,
Dr. Umamaheswari D
Assistant Professor
Department of Economics
CHRIST (DEEMED TO BE UNIVERSITY)
Yeshwanthpur Campus, Bengaluru
31st, July 2024
BUILT-IN FUNCTIONS
● abs()
Gives out the absolute value of a number.
● all()
Gives out `True` if all elements of an iterable are true (or if the iterable is empty).
● any()
Gives out `True` if any element of an iterable is true. If the iterable is empty, it Gives out
`False`.
● ascii()
Gives out a string containing a printable representation of an object, but only ASCII characters.
Non-ASCII characters are escaped.
● bin()
Converts an integer to a binary string.
● bool()
Converts a value to a Boolean, using the standard truth testing procedure.
● breakpoint()
Drops into the debugger at the call site. (New in Python 3.7)
● bytearray()
Gives out an array of bytes.
● bytes()
Gives out a bytes object.
● callable()
Gives out `True` if the object appears callable, and `False` if not.
● chr()
Gives out the string representing a character whose Unicode code point is the integer `i`.
● classmethod()
Gives out a class method for the given function.
● compile()
Compiles the source into a code or AST object. Code objects can be executed by `exec()` or
`eval()`.
● complex()
Creates a complex number or converts a string or number to a complex number.
● delattr()
Deletes the named attribute from an object.
● dict()
Creates a new dictionary.
● dir()
Attempts to return a list of valid attributes of the object.
● divmod()
Takes two numbers and Gives out a pair of numbers (a tuple) consisting of their quotient and
remainder.
● enumerate()
Adds a counter to an iterable and gives out it as an enumerate object.
● eval()
Parses the expression passed to this function and runs Python expression (code) within the
program.
● exec()
Executes the dynamically created program, which is either a string or a code object.
● filter()
Constructs an iterator from those elements of iterable for which function gives out true.
● float()
Converts a number or a string to a floating-point number.
● format()
Gives out a formatted representation of the given value controlled by the format specifier.
● frozenset()
Gives out a new frozenset object, optionally with elements taken from iterable.
● getattr()
Gives out the value of the named attribute of an object.
● globals()
Gives out a dictionary representing the current global symbol table.
● hasattr()
Gives out `True` if the object has the named attribute. Otherwise `False`.
● hash()
Gives out the hash value of the object (if it has one).
● help()
Invokes the built-in help system.
● hex()
Converts an integer number to a lowercase hexadecimal string prefixed with "0x".
● id()
Gives out the identity of an object.
● input()
Reads a line from input, converts it to a string (stripping a trailing newline), and Gives out that.
● int()
Converts a number or string to an integer.
● isinstance()
Check if an object is an instance or subclass of a class or tuple of classes.
● issubclass()
Checks if a class is a subclass of another class or tuple of classes.
● iter()
Gives out an iterator object.
● len()
Gives out the length (the number of items) of an object.
● list()
Creates a list.
● locals()
Updates and Gives out a dictionary representing the current local symbol table.
● map()
Applies a function to all the items in an input list.
● max()
Gives out the largest item in an iterable or the largest of
● memoryview()
Gives out a memory view object.
● min()
Gives out the smallest item in an iterable or the smallest of two or more arguments.
● next()
Retrieves the next item from an iterator.
● object()
Gives out a new featureless object. `object` is a base for all classes.
● oct()
Converts an integer to an octal string.
● open()
Opens a file and Gives out a corresponding file object.
● ord()
Gives out an integer representing the Unicode code point of the given Unicode character.
● pow()
Gives out x raised to the power y.
● print()
Prints the given object(s) to the standard output device (screen) or to the text stream file.
● property()
Gives out a property attribute.
● range()
Gives out a sequence of numbers, starting from 0 by default, and increments by 1 (by default),
and stops before a specified number.
● repr()
Gives out a string containing a printable representation of an object.
● reversed()
Gives out a reversed iterator.
● set()
Gives out a new set object, optionally with elements taken from iterable.
● setattr()
Sets the value of the named attribute of an object.
● slice()
Gives out a slice object representing the set of indices specified by `range(start, stop, step)`.
● sorted()
Gives out a new sorted list from the items in iterable.
● staticmethod()
Gives out a static method for the given function.
● str()
Gives out a string version of the object.
● sum()
Sums start and the items of an iterable from left to right and Gives out the total.
● super()
Gives out a proxy object that delegates method calls to a parent or sibling class of `type`.
● tuple()
Gives out a tuple.
● type()
Gives out the type of an object.
● vars()
Gives out the `__dict__` attribute for a module, class, instance, or any other object with a
`__dict__` attribute.
● zip()
Gives out an iterator of tuples, where the i-th tuple contains the i-th element from each of
the argument sequences or iterables.
● __import__()
This function is invoked by the `import` statement.