The log10()
function uses the base 10 to calculate the logarithm of a number.
Figure 1 shows the mathematical representation of the log10()
function and the corresponding representation in Python.
The
math
module is required for this function.
log10(number)
This function requires a number whose logarithm base 10 is to be calculated, and it must be greater than zero.
log10()
uses the base 10 to return the logarithm of a number.
The following example shows how we can use the log10()
function in Python.
#Module requiredimport math#exampleprint ("log10(10) : ", math.log10(10))print ("log10(2) : ", math.log10(2))print ("log10(15.2) : ", math.log10(15.2))