Python has User-Defined Functions and Built-in Functions types of functions. Functions are blocks of code written to carry out a specified task.
- Built-in Functions: these are already written or defined in Python.
- User-Defined Functions: It is defined by a programmer to reduce the complexity and to use that function according to their need.
Types of functions in Python with examples
Simple example code.
# In built functions
l = [1, 2, 3, 4, 5]
print(len(l))
print(type(l))
# Example of user defined function
x = 3
y = 4
def add():
print(x + y)
add()
Output:

Below are some built-in functions of Python.
| Function name | Description |
| len() | It returns the length of an object/value. |
| list() | It returns a list. |
| max() | It is used to return the maximum value from a sequence (list, sets), etc. |
| min() | It is used to return the minimum value from a sequence (list, sets), etc. |
| open() | It is used to open a file. |
| print() | It is used to print statements. |
| str() | It is used to return a string object/value. |
| sum() | It is used to sum the values inside the sequence. |
| type() | It is used to return the type of object. |
| tuple() | It is used to return a tuple. |
Do comment if you have any doubts or suggestions on this Python basic topic.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
Windows 10
Python 3.10.1
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.