Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python log() function

Python log() function

Python Numbers Python Numbers


Description

log() returns the natural logarithm of x.


Syntax

The syntax of the log() method is as follows:



import math



math.log(x[, base])

**Note:** log() cannot be accessed directly; you need to import the math module and call the method through the static object.


Parameters