Posted by : ANIL KUMAR MULA Friday, 2 January 2015


In python we can import user defined modules, modules are programs written by the users, here is a simple module and using that module in the program.


define a module(user defined name it as anil.py)

 def add(s,t):
    u = s + t
    return [s,t,u]

def sub(s=0,t=0):
    u = s - t
    return [s,t,u]

importing the user defined module

import anil

anil.add(2,3)

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Anil Kumar Mula - Skyblue - Powered by Blogger - Designed by Johanes Djogan -