Python‎ > ‎math‎ > ‎

math.log()

http://www.adilwaseem.com/

Definition
Will return the value how many time, we need to multiple the base value to get the value of x.

Syntax
math.log(x,base)

Parameters
x,base=numbers

Examples
The returns is:
 >>>import math
>>> math.log(9,3)
2.0
>>> math.log(25,5)
2.0
>>> math.log(49,7)
2.0
>>> 


if statement sum(map(lambda).__le__()
The lambda returns with equation computation.
import math
x=[math.log(2,10),math.log10(22), math.log2(2)]
y=[math.trunc(2.1)]
if sum(map(lambda a,b: a+b/2, x,y)).__le__(y):
    print("The return is large or equal to 2.0")
else:
   print ("The value does not meet the criteria")

>>> 
The return is large or equal to 2.0
>>>

Comments