-
Notifications
You must be signed in to change notification settings - Fork 1
Modules in Python
wilsonshamim edited this page Jun 12, 2018
·
3 revisions
modules are like other python files with functions, variables. A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module is a Python object with arbitrarily named attributes that you can bind and reference.
Simply, a module is a file consisting of Python code. A module can define functions, classes and variables. A module can also include runnable code.
Steps:
- create a python files named FunctionDemo.py.
- create a function sum. now you can access the function using below
from FunctionDemo import sum,lambdafun print("---",sum(1,3)) print(lambdafun(1,3,4))