🐍 Pythons learning
PYTHON • DATA SCIENCE • AI

Master Python, Data Science & Machine Learning

#Python #Pandas #NumPy #MachineLearning #Projects

Monday, November 23, 2026

Math Module in Python: Essential Mathematical Functions

The math module in Python provides access to mathematical functions defined by the C standard. It includes functions for trigonometry, logarithms, power functions, rounding, and common mathematical constants like pi and e.


Installation:

Built-in module (No installation required)


Key Features:

- Trigonometric and hyperbolic functions (sin, cos, tan, asin, acos)

- Logarithmic and exponential functions (log, log10, exp, pow)

- Rounding and remainder functions (ceil, floor, trunc, fmod)

- Mathematical constants (math.pi, math.e, math.tau, math.inf)


Code Example:

import math


# Calculate square root, factorial, and trigonometric values

print("Square Root of 16:", math.sqrt(16))

print("Factorial of 5:", math.factorial(5))

print("Value of Pi:", math.pi)

print("Sine of 90 degrees:", math.sin(math.radians(90)))

No comments:

JSON Module in Python: Parsing and Writing JSON Data

The json module in Python allows you to encode and decode JSON (JavaScript Object Notation) data. It provides built-in methods for convertin...