Python's math module includes the attribute e
, which returns the Euler's number e
(2.71828...).
#import math module
import math
#Print the value of Euler's number
print(math.e)
math.e
import math
print(math.log(10, math.e))
module usage
module usage
random.random()
random.randint()
random.choice()
Choosing random item(s)
random.choices()
random.sample()
random.shuffle()
Introduction
cmath module
math.sin()
math.cos()
math.tan()
math.asin()
math.acos()
math.atan()
math.atan2()
math.sinh()
math.cosh()
math.tanh()
math.asinh()
math.acosh()
math.atanh()
math.exp()
math.pow()
math.sqrt()
math.log()
math.log2()
math.log10()
math.ceil()
math.floor()
math.trunc()
math.modf()
math.fmod()
math.fabs()
math.factorial()
math.gcd()
math.lcm()
math.isqrt()
math.isfinite()
math.isinf()
math.isnan()
math.ldexp()
math.frexp()
math.degrees()
math.radians()
math.copysign()
math.fsum()
math.gamma()
math.hypot()
math.isclose()
math.lgamma()
math.prod()
math.perm()
math.erf()
math.erfc()
math.dist()
math.comb()
math.remainder()
math.pi
math.e
math.inf
math.nan
math.tau
cmath.acosh()
cmath.acos()
cmath.asin()
cmath.asinh()
cmath.atan()
cmath.atanh()
cmath.cos()
cmath.cosh()
cmath.exp()
cmath.isclose()
cmath.isfinite()
cmath.isinf()
cmath.isnan()
cmath.log()
cmath.log10()
cmath.phase()
cmath.polar()
cmath.rect()
cmath.sin()
cmath.sinh()
cmath.sqrt()
cmath.tan()
cmath.tanh()
cmath.e
cmath.inf
cmath.infj
cmath.nan
cmath.nanj
cmath.pi
cmath.tau
Python's math module includes the attribute e
, which returns the Euler's number e
(2.71828...).
#import math module
import math
#Print the value of Euler's number
print(math.e)
math.e
import math
print(math.log(10, math.e))