Day #3 - Python Modules & Pip

Day #3 - Python Modules & Pip

Introduction

In this blog, I will discuss what I learnt on day 3 of my coding journey i.e Modules and Pip in Python and how to use the code to import modules. So let's get started......

What is PIP?

A PIP is a package manager, that helps you to install python modules. It helps to bring everything (various libraries ) from the internet to a python interpreter.

pip install pandas

What is MODULE?

  • The module is like a code library which can be used to borrow code written by somebody else in our python program.

  • Modules are used because we don’t want to code now and then some basic functions and waste time

  • For example, if someone has written some useful program then the other person can use this code and use the function.

  • So basically there are two types of modules in python:

    Built-In Modules, External Modules

Modules ANALOGY

Built-In Modules

Built-in Modules are ready to import and use. There is no need for them to be installed explicitly. They are shipped or imported with the python interpreter itself.

External Modules

External modules are imported from third parties. PIP as a package manager is used to install external modules. Since external modules are explicitly installed and are from third parties we may have to install different versions as the Modules may get an upgrade if more functionalities are added.

Using modules

We use the "import " keyword to bring the modules onto the python

example -

pip install <modulename>

import <modulename>

pip install pandas

import pandas

Why modules are needed?

Code in Modules is written by experts and code is being used by various people, so code is tested thoroughly. The chances of human error in code are negligible and hence modules can be used to cut down some processes. Using modules reduces human error and effort and hence helps focus on other problem areas.

Resources Used

Conclusion

Thanks, guys for going through this blog post. So this is it for the BLOG post on Day #3 of Python.

See you in the next one.....


About Me

Hey Guys, I am Chintan Jain from CodeWithJain. I am a trader and content creator. I am also passionate about tech and hence wanted to explore the field of tech. I always wanted to learn to code so I watched many tutorials but procrastinated practising coding. To get into the habit of coding consistently I am starting to BLOG with HASHNODE on daily basis.

I will document my coding journey from scratch and share my daily learnings in a blog post on HASHNODE. I hope you all will enjoy my content and my coding journey.

So what are you waiting for, smash the FOLLOW and LIKE buttons and follow along my coding journey, a step to create more beautiful digital products and empower people.