math

What it is good for?

math contains mathematical functions similar to a scientific calculator.

In the module, you find various trigonometric and exponential functions. In addition the two constants pi and e are included.

Installed with Python by default

yes

Example

Calculating a square root, a sine, an exponential function and a logarithm.

  1. import math
  2. print(math.sqrt(49))
  3. print(math.sin(math.pi / 2))
  4. print(math.exp(1.0) == math.e)
  5. print(math.log(256,2))

Where to learn more?

https://docs.python.org/3/library/math.html