← Retour à la référence Python

()

Module : math

Retourne le logarithme de x. Si la base est omise, retourne le logarithme naturel (base e).

📝 Syntaxe

math.log(x[, base])

⚙️ Paramètres

x

Nombre positif (float ou int).

base

Base du logarithme (optionnel, par défaut e).

💡 Exemples

import math
math.log(100, 10)
2.0
EdTech AI