Python log(x, base) is an inbuilt function that is used to get the basic logarithm function. The log() function is used to get a log of x of a particular base. The log() function is under the math library, so we need to import the math library to use the log() function.

Python log(x, base)

Python log(x, base) function is used to compute the natural logarithm (base e) of a. If 2 arguments are passed, it computes the logarithm of the desired base of argument a, numerically value of log(a)/log(Base).

Syntax

math.log(num, Base)

This function takes two arguments:

num -> whose log we want to find

Base -> with which base we want to find a log

#python

Python log(x, base) Function Example
2.05 GEEK