A function is a block code that takes in some data and, either performs some kind of transformation and returns the transformed data, or performs some task on the data, or both.
Note that the function block is intended by four spaces.
To call a function means that we are telling the program to execute the function. If there is a return value defined, the function would return the value, else the function would return none.
To call the function, we write the name of the function followed by parentheses.
syntax:-
def function_name(): body of function function_name()
e.g.,
def my_function(): print("hello") print("How are you?") my_function()
Output- hello How are you?
This is how we can call function in python.