Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,943 questions

51,884 answers

573 users

How to calculate the base 10 logarithm of a number in Python

1 Answer

0 votes
import math

print("math.log10(1) = ", math.log10(1))
print("math.log10(5) = ", math.log10(5))
print("math.log10(100) = ", math.log10(100))
print("math.log10(125) = ", math.log10(125))
print("math.log10(125) / math.log10(5) = ", math.log10(125) / math.log10(5))
print("math.log10(math.pi) = ", math.log10(math.pi))
print("math.log10(1000) = ", math.log10(1000))
print("math.log10(0.001) = ", math.log10(0.001))


'''
run:

math.log10(1) =  0.0
math.log10(5) =  0.6989700043360189
math.log10(100) =  2.0
math.log10(125) =  2.0969100130080562
math.log10(125) / math.log10(5) =  2.9999999999999996
math.log10(math.pi) =  0.49714987269413385
math.log10(1000) =  3.0
math.log10(0.001) =  -3.0

'''

 



answered Oct 18, 2017 by avibootz
edited Oct 18, 2017 by avibootz

Related questions

1 answer 166 views
166 views asked Feb 8, 2020 by avibootz
2 answers 315 views
3 answers 333 views
1 answer 275 views
...