Home >>Python math Module >Python math.log() Method
Python math.log() method is used to return the natural logarithm of the given input number or the logarithm of number to the base.
Syntax:math.log(x, base)
Parameter | Description |
---|---|
x | This is a required parameter. It defines the value to calculate the logarithm for. |
base | This is an optional parameter. It defines the logarithmic base to use. |
import math
print(math.log(10))
print(math.log(2))
print(math.log(1))
import math
print(math.log(10,10))
print(math.log(2,10))
print(math.log(1,10))