In this tutorial we are going to learn :
- Functions in Python
- Arguments
- Types of Functions
Â
Â
Functions in Python
Â
In Python we used lots of functions such as print(), input(), lower() etc. Now we are going to create our functions.
- Function is a block of code that only runs when it is called. In our programs, we can create our functions one time and we can use them over and over again whenever we need them. So functions save us from code complexity.
- To create functions we use the def keyword.
- To call a function we use the function name with parentheses.
Example :