Site icon TestingDocs.com

Python Built-in Functions

Overview

Let’s learn about Python Built-in functions in this tutorial. Python’s standard library comes with various built-in functions that are always available for use. These functions are integral to performing common tasks in Python programming.

Python Built-in Functions

Some important built-in functions are as follows:

 

Python Built-In Function
Description
abs()  This function returns the absolute value of the number.
len() This function returns the number of items of an object.
map()

 

The map() function returns an iterator that applies the function to every item of iterable, yielding the results.
min() This function returns the smallest item in an iterable.
max() This function returns the largest item in an iterable.
sum() This function returns the sum of the items of an iterable like the list.
print() This function prints the objects to the stream.
input() This function reads a line from the input, converts it to a string, and returns that to the program.
int() This function converts a string or number to an integer.
float() This function converts a string or a number to a floating point.
str() This function converts the object into a string and returns it.
hash() This function returns the hash value of the object.
enumerate() This function adds a counter to an iterable and returns it as an enumerate object.

Python’s standard library offers various built-in functions that simplify common operations in Python programming, making code writing more efficient.

Python Tutorials

Python Tutorial on this website can be found at:

https://www.testingdocs.com/python-tutorials/

More information on Python is available at the official website:

https://www.python.org

Exit mobile version