Skip to main content

Command Palette

Search for a command to run...

Introduction to Python Programming

Learning Python: Get to Know Modules, Comments, and PIP

Published
1 min read

Modules

A module is a file containing code written by somebody else (usually) which can be imported and used in our programs.

Types of modules

There are two types of modules in Python.

1. Built in Modules (Preinstalled in Python)

Some examples of built in modules are os, random etc.

2. External Modules (Need to install using pip)

Some examples of external modules are TensorFlow, flask etc.

Pip

Pip is the package manager for python. You can use pip to install a module on your system.

E.g.

Here, How we can simply install a Pip In Python, Using System terminal.

pip install flask # Installs Flask Module

Comments

Comments are used to write something which the programmer does not want to execute. This can be used to mark author name, date etc

Types of comments

There are two types of comments in python.

1. Single Line Comments: To write a single line comment just add a ‘#’ at the start of the line.

# This is a Single-Line Comment

2. Multiline Comments: To write multi-line comments you can use ‘#’ at each line or you can use the multiline string (""" """)

"""This is an amazing
example of a Multiline
comment!"""