log10() function in python by R4R Team

-log10() is a python function which is predefined in math library. and use for find the value of log with base 10

Example-

number is 1000
log10 will give 3.0

number is 10
log10 will give 1.0

number is 565
log10 will give 2.7520484478194387

program-

import math
print("Enter any number")
a=int(input())
print("Log10 of number is "+str(math.log10(a)))

print("Enter another number")
a=int(input())
print("Log10 of number is "+str(math.log10(a)))


output-

Enter any number
565
Log10 of number is 2.7520484478194387
Enter another number
34
Log10 of number is 1.5314789170422551

Enter any number
1000
Log10 of number is 3.0 Enter another number
100
Log10 of number is 2.0


-In this program, firstly we import the 'math' library by using import math then take a input of integer value and print the log10 value.


Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!