Custom Function in Python
Custom Function in Python, In this article i will create a simple Python function using Python.
Function in Python
- Function is created to hold specific function to execute a specific task when call
- Use the “def” key work , to create a new function
- To create a function you need an indentation of 4 spacing
>>> def calculate_age(year): ... age =2018-year ... return age
Calling the function
>>> calculate_age(2000) 18 >>>
Check out List and Dictionaries in Python here
Leave a Reply