Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Python – Find Natural Logarithm/Logarithm – log() Function with Examples

log() function is used to find the the natural logarithm of x (to base e in Python for the given input(x – parameter).

 

Syntax of log() Function

The syntax of log() function in Python is:

 

Parameters of log() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, log() function will return an Error.

 

Compatibility

log() function is available and compatible with both Python 2.x and 3.x. This function is a part of python standard math library.

 

Return Value of log() Function in Python

log() function returns the natural logarithm of x (to base e for the given input.

 

Python log() Function Example


Output:

 

LearnAndLearn.com © 2018 - All rights reserved