programplug Logo




Python Function


A function is a self-contained block of statements that perform a specific task. A function can be call many times.By using function we can divide a code into the function.Function provides modularity and code reusability.


Types Of Functions


There are two types of functions-

» Library Functions or Built-in Functions
» User-defined functions


Library Functions

They Are Pre Defined header files.Python used many predefined functions.

User-defined functions

These functions are declared by the user depends on their requirements.It reduces complexity of a big program.


def (function_name)(parameters):   

Keyword def is used to start and declare a function.


def add(a,b):   
    s=a+b  
    print "Sum of two numbers is :"  
       print s  
    add(20,30) #Calling the sum Function     

output:
Sum of two numbers is :50






Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
0000000000

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy