Python Built-in Functions Examples

In this Python article we want to learn about Python Built-in Functions Examples, Python is one of the most popular programming languages, and the reason is this that Python has a large set of builtin functions. these functions are pre defined in Python language, and can be used to perform different tasks. in this article we want to talk about some examples of Python builtin functions.

 

 

  1. Print()

print() function is used to display output on the console. it takes one or more arguments and displays them on the console. this is an example:

 

 

This will be the result

Python Built-in Functions Examples
Python Built-in Functions Examples

 

 

  1. Len()

len() function is used to determine the length of a string, list or any iterable object. this is an example, run the code it will return 21.

 

 

  1. Range()

range() function is used to generate a sequence of numbers. it takes one, two or three arguments, this is an example.

 

 

This will be the result

Built Function in Python
Built Function in Python

 

 

  1. Type()

type() function is used to determine type of an object. this is an example, this will return <class ‘str’>.

 

 

  1. Max() and Min()

max() and min() functions are used to find maximum and minimum values in an iterable object, this is an example:

 

 

This will be the result

Python Function
Python Function

 

 

  1. Sum()

sum() function is used to find sum of all elements in an iterable object. this is an example, if you run this code, you will receive 28.

 

 

  1. Sorted()

sorted() function is used to sort an iterable object in ascending order. this is our example:

 

 

This will be the result

Python Sort Function
Python Sort Function

 

 

  1. Zip()

zip() function is used to combine two or more iterable objects into single iterable object. this is our example:

 

 

 

Run the code and this will be the result

Python Zip Function
Python Zip Function

 

 

Learn More

 

Leave a Comment