The python ‘math’ module is a standard library module that provides a variety of mathematical functions and consonants.it is designed to facilitate performing mathematical operations in a python program, covering both basic and advanced mathematical tasks and also includes key features like Basic mathematical functions, Trigonometric functions, logarithmic and exponential functions and Mathematical Constants these features are helpful to use the math module. Math module is a inbuilt in python library made to simplify mathematical tasks.
Python Math Module
Basically, the python math module are essentials for mathematical calculations and essential part of most python development. And there are some mathematical operators, such as addition(+),subtraction(-),division(/)and Multiplication(*) and other more advanced operations. The python module contains some predefined constants which provide consistency throughout the code and module includes some mathematical constants and values like
- pi
- Tau
- Eulers number
- infinity
- Not a number
import math, you import the code in the math module and make it available to use. In the second line, you access the pi variable within the math module. math is part of Python’s standard library, which means that it’s always available to import when you’re running Python.
import math gamma_var = 10 print ("The gamma value of the given argument is : "+ str(math.gamma(gamma_var)))
output:
The gamma value of the given argument is : 362880.0