[Type C]Q2. Create a module MassConversion.py that stores a function for mass conversion.

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.

Program code:

A module is a file containing Python definitions and statements.

A module can define functions, classes and variables.

A module can also include runnable code.

We can define our most used functions in a module and import it, instead of copying their definitions into different programs.

We can import a module using the import statement.

Python Libraries and modules are demonstrated in above program.

To view all the lessons in chapter 1: http://computertutor.in/class-12-computer-science/chapter-4/

To view entire class 12 computer science study material: http://computertutor.in/resources/

You cannot copy content of this page