Experiment No 8 Module
Experiment No 8 Module
ENGINEERING LAB
Expt. No. 8
Date : Program Based on Concept of Module.
Purpose:
Students must Learn Python Module because
Access to Libraries: Learning how to use modules enables us to leverage their built-
in functionality for complex tasks (like data analysis, machine learning, web
development) without needing to build everything from scratch.
Faster Learning and Application: We can quickly start building real-world
applications by using existing Python modules. Modules like math, random provide
built-in functions that you can use right away, allowing you to focus on
understanding Python basics instead of writing everything manually.
Learning How to Import and Use Libraries: Learning about Python modules
teaches us how to import and use these libraries, opening the door to more advanced
projects.
Learning Problem-Solving Skills: When we learn how to use different modules,
you also improve your problem-solving skills. we begin to think of problems in
terms of what modules or pre-built tools can help you solve them, rather than
starting from zero each time.
Objectives:
Understand the Concept of Modules: Learn what Python modules are and how
they help break down complex programs into smaller, manageable units
Learn to Import and Use Built-in Modules: Master how to import and use built-in
Python modules
Enhance Problem-Solving Skills Using Modules: Use Python modules to solve
real-world problems effectively
Theory:
Module is a file containing python definitions, functions, variables, classes and statements.
The extension of this file is .py.
1) Importing Python Modules:
a) Using Import statement:
import < module_name
import < module1>, <module2>………. <module>
To access a particular method from any module: ModuleName.functionName()
2. Module Aliasing:
Aliasing means to give an alternating name. We can rename the module at the time
of import, using as keyword.
import<Module Name> as <alias name>
Q. No Question CO BL
1. What is the difference between Import and From statement? 2EEVS207_5 K1
2. What are the Functions in Math Module? 2EEVS207_5 K1
3. What are the Functions in Statistics Module? 2EEVS207_5 K1
4. What is the difference between Ceil and Floor in Math module? 2EEVS207_5 K1
5. What is the meaning of Mean, Mode and Median ? 2EEVS207_5 K1
Conclusion: