Python Standard Library. The math module has all the basic math functions you need, such as: Trigonometric functions: sin(x), cos(x), etc. Logarithmic functions: log(), log10(), etc. Statistics: mean(), stdev(), etc. Constants like pi, e, inf, nan, etc. math Module.