Definition of Function

Function
Functions 
are 
mini-programs
 
or 
a 
block 
of 
code 
that 
are 
reusable
 
anywhere 
in 
your 
program. 
A 
function 
performs 
a 
task, 
and 
once 
it 
is 
defined 
we 
can 
perform 
the 
task 
by 
calling
 
the 
function 
using 
the 
function 
name.

In-Built Functions

Python 
has 
a 
set 
of 
in-built
 
functions 
that 
are 
already 
defined 
to 
perform 
a 
certain 
task.
The 
python 
interpreter 
has 
several 
functions 
that 
are 
always 
present 
for 
use.
Eg.
 
print()
, 
min()
, 
max()
, 
len()
, 
etc.

User Defined Functions

Python 
allows 
us 
to 
define 
and 
use 
our 
own 
custom 
logic 
inside 
a 
function.
Functions 
that 
we 
define 
ourselves 
to 
do 
certain 
specific 
tasks 
are 
referred 
to 
as 
user-defined
 
functions.

Calling a Function

Calling
 
(Using) 
a 
function 
is 
done 
in 
a 
particular 
way 
in 
Python.
We 
just 
write 
the 
name 
of 
the 
function 
followed 
by 
round 
()
 
brackets 
containing 
the 
arguments
.
function_name(arguments)
word = 'apple'
print(len(word))
#Here len() function has the argument 'apple', and print() function has the argument as len()