A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_math_log.asp below:

Website Navigation


Python math.log() Method

Python math.log() Method

❮ Math Methods

Example

Find the natural logarithm of different numbers

# Import math Library

import math

# Return the natural logarithm of different numbers

print(math.log(2.7183))

print(math.log(2))

print(math.log(1))

Try it Yourself » Definition and Usage

The math.log() method returns the natural logarithm of a number, or the logarithm of number to base.

Syntax Parameter Values Parameter Description x Required. Specifies the value to calculate the logarithm for. If the value is 0 or a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError base Optional. The logarithmic base to use. Default is 'e' Technical Details Return Value: A float value, representing the natural logarithm of a number, or the logarithm of number to base Python Version: Changed in version 2.3 Change Log: The base parameter was added

❮ Math Methods

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4