finding log base 2 in python

Solutions on MaxInterview for finding log base 2 in python by the best coders in the world

showing results for - "finding log base 2 in python"
Baptiste
13 Jan 2017
1# Python code to demonstrate the working of
2# log(a,Base)
3  
4import math
5  
6# Printing the log base e of 14
7print ("Natural logarithm of 14 is : ", end="")
8print (math.log(14))
9  
10# Printing the log base 5 of 14
11print ("Logarithm base 5 of 14 is : ", end="")
12print (math.log(14,5))
13