By using our services, you agree to our Privacy Policy. Click to accept.

#45 Python Tutorial for Beginners | Modules

Industry Ready Java Spring Developer - Live Course :
For More Queries WhatsApp or Call on : +919008963671

website :

Instagram :
Linkedin :
TELUSKO Android App :
Discord :

In this lecture we will learn:
- What is a module in Python?
- Use of module
- How to create a module in Python?
- Advantages of modules
- Steps to add a separate module
- Different ways to import a module

- Debugging simply means removing bugs.
- The concept of modules is used when instead of writing a big software in one file, we will break it down into small parts.
- A module is a file containing Python definitions and statements. It can consist of variables, functions, classes, etc.
- We have to import a module to use the defined functions in it.
- Module name is the file name with the extension .py.
- Any number of modules can be created and we can also import them into one file.
- Definitions from a module can be imported into other modules or the main module also.
- We have to import the module to use its definitions in the code. When the interpreter encounters an import statement, it imports the module if the module is present in the search path.
- There are some in-built modules present inside python.
- We can also define our modules and use them in code, and they are known as user-defined modules.

Advantages of Modules:-
- If we want to change anything in one module then that change will not reflect in any other module.
- Reuse the same modules in different projects that have similar features.

Steps to add a separate module:-
1. New - Python File
2. Write the name of a new Python File ( name of a module)

Different ways to import a module:-
1. import module_name (Definitions of all functions can be accessed by using module_name)
2. from module_name import function_name ( We can use the definition of a particular function)
3. from module_name import * ( Definition of all functions can be used)

Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist :
Python Tutorial in Hindi :

Github :-

Java and Spring Framework For beginners with Spring Boot : -

Java Tutorial for Beginners (2023) :-

Editing Monitors :

Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :

PayPal Id : navinreddy20
Patreon : navinreddy20

Share on FacebookShare on TwitterShare on PinterestShare on RedditShare on TumblrShare on VkontakteShare on LinkedinShare on BloggerShare on Telegram
Copy URL
By using our services, you agree to our Privacy Policy.
Alternative random YouTube videos generator: vTomb
Powered by Wildsbet.

YoutuBeRandom © 2023