math module

The standard library module of mathematical functions and constants, such as sqrt, floor, ceil, sin and pi.

In more detail

Its functions work on floats and integers; math.isclose compares floats safely. For averages and medians use the statistics module.

Example

import math
math.sqrt(16), math.floor(2.7)

Related terms

Taught in

References

Certification courses