Function by Shweta Dhraik


Functions are nothing but these are the number of statements which are grouped together to do some particular task in function there are two part one is function call and function definition.now the example of function :

def avg(n1,n2,n3):

      return(n1,n2,n3)/3.0

print(“welcome”)

result1 = (10,20,30)      #Function call

result2 = (1,2,3)

result3 = (3.1,2,4.5)

print(result1)

print(result2)

print(result3)

 Output :welcome

20.0

3.0

3.199

Why we need to use are function concept in our program?

In our program we call this avg function thrice it is a small example like this avg function contains single line in the function body let us suppose it contains 100 line if we did not use function concept then we need to type the 100 line it will be very difficult job and it will take space and time instead of that we can group that statement so this function concept reduce space and time.

0 views

Contact Us:

A-116, The Corenthum A-65,

Sector 62

Noida 201301

UP, India

Phone: +91 8882050481

Email: info@theikigailab.com

© 2020 TheIkigaiLab  Terms of Use Privacy and Security Statement