## Introduction

A similar concept is applied to programming. A large is divided into modules. A module is a set of small coding instructions written in a programming language. These modules create a library.

## Definition

## Commonly Used libraries

Some commonly used python libraries are as following:

**Standard Library:** It provides some common standard IO operation related functions such as print(), input(), int() along with some math modules, random modules, statistic modules, etc.

**NumPy Library:**This library is used to handle arrays to cater basic mathematical operations. Ex.: square(), absoulte(), log(), sqrt() etc.

**SciPY Library:**This offers algorithmic and mathematical functions for scientific calculations. Ex.: io(), linalg(), interopolate() etc

**Matplotlib Library:**This library offers functions related to graphs and charts in python. Ex.: plot(), label(), show() etc

**Tkinter Library:**This library provides functions to design GUI based interface for different applications. Ex.: tkMessageBox(), tkColorChooser(), tkSimpleDialog() etc.

## Python Module

## Structure of Python module:

A python module is a python file with comments (docstrings), variables and constants, classes, objects, statements, functions, etc.

### docstrings

### variables and constants:

### classes

### objects

### Statements

### Functions

## import python module

import <command> : import math, import NumPy etc

from <module> import <object>: from math import pi, sqrt

**Note:**User can import multiple objects from <module> import <object> with comma-separated objects or * to import all objects.

## Using Mathematical Functions

import math

The following functions are the most commonly used functions provided by the math module:

### ceil()

Ex.: >>> math.ceil(12345.6786)

Output:12346

### fabs()

Ex.: >>> math.fabs(-15)

Output:15.0

### factorial()

Ex.: >>> math.faactorial(5)

Output:120

### floor()

Ex.: >>> math.floor(12345.6786)

Output:1234

### fmod()

Ex.: >>> math.fmod(15.8899,4)

Output:3.889900000000001

### fsum()

Ex.: >>> math.fsum([1.5,2.5,3.5])

Output:7.5

### gcd()

Ex.: >>> math.gcd(42,28)

Output:14

### theremainder()

Ex.: >>> math.remainder(12,5)

Output:2.0

### pow()

Ex.: >>> math.pow(5,3)

Output:125.0

The function pow() can accept three arguments also. When it accepts three arguments it will be as follows:

>>> p=pow(5,2,3)

Output:1

When it accepts three variables it will be evaluated as (x**y)%z. So here 5^2 is 25%3 is 1.

### sqrt()

Ex.: >>> math.sqrt(100)

Output:10.0

## String Functions:

To use string functions a variable needs to assign with a specific string value.

For Ex.: str =”fun with python”

### capitalize()

Output:’Fun with python’

### center()

Ex.: >>> str2=str.center(20,’*’)

Output:’**fun with python***’

### count()

Ex.: >>> str.count(‘with’,4,10)

Output:1

### endswith()

Ex.: >>> str.endswith(‘on’,0,20)

Output: True

### find()

Ex.: >>> str.find(‘with’,4,10)

Output:4

### isalnum()

Ex.: >>> str=’funwithpython2020′

>>> str.isalnum()

Output: True Similarly isalpha(), isdigit(), islower(), isspace(), istitle, isupper() functions return True respectively, otherwise false.

### join()

Ex.: >>>str=’fun with python 2020′

>>> str.join([‘hello! ‘,’ is amazing’)

Output: ‘hello! fun with python 2020 is amazing’

### upper()

Output:’FUN WITH PYTHON 2020′

### title()

Output:’Fun With Python 2020′

### swapcase()

Output:’FUN WITH PYTHON 2020′

### split()

Output:[‘fun’,’with’,’python’,’2020′]

### ljust()

Output:’fun with python 2020******’

### lower()

Output:’fun with python 2020

### lstrip()

Output:’n with python 2020′

### replace()

Output:’play with python 2020′

nice

Good information 👍

remainder() function doesn't work in Python 3.8

Thanks

Thanks

Yes sir