FUNCTIONS — PYTHON

A function is a block of code which runs when it is called.You can pass data as parameters in a function.Function returns data as a a result.

Vidhya Suresh
1 min readJun 12, 2020

STEPS TO BE FOLLOWED WHILE WRITING A FUNCTION

  1. Declare the function with keyword def followed by function name
  2. pass the parameters inside the parentheses and end it with colon
  3. add the code block which is to executed
  4. call the function

FUNCTION DEFINITION

def requiredArg (str,num):

FUNCTION CALLING

requiredArg (“Hello”,12)

EXAMPLES:

Learning is like a ray,it has a starting point but never has an end.It is an unending journey of each and everybody’s life. Have fun coding.Have a great day. THANK YOU

--

--