Modules | Comments | Pip in Python - Programmrs

 MODULES, COMMENTS, AND PIP IN PYTHON


Let's write our first Python program by creating a python file (first.py) and let us paste the following code into the above program.

Python Module


print("Hello World")

When we execute this program, we see the output Hello World in the Output Screen.


MODULES

A Module is a file that basically contains the code written by others, but it can be imported and used in our own programs

PIP 

Pip is the package manager for python which is used to install the modules in our program/system.  Eg. If you have to import a flask or Django module in your program first you have to install it using

pip install flask
pip install pandas


TYPES OF MODULES

There are two types of modules in python.
  • Built-in Modules - Pre-installed in python
  • External Modules - Have to install using pip

Example of built-in modules is os, ABC, etc.
Example of External modules is TensorFlow, flask, etc.


COMMENTS

Comments are used to write something in the program which the programmer doesn't want to execute.

Types of Comments

There are two types of Comments in Python:
  • Single Line Comment - Written using '#'
  • Multi-Line Comment -  Written using 'comment'

Post a Comment

Previous Post Next Post