Functions in Python


☞ A function is a subprogram that acts on data and often returns a value.

☞ It works on divide and conquer approach.

Syntax :

 def <function_name>([parameters]):
               statement 1 
               statement 2 
               ....... 

Use of Functions

☞ Large program is broken down into smaller units, due to which program handling becomes easier.

☞ Reduce program size.

☞ Increases readability.

☞ Code reusability.