Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 22 Online
OpenStudy (anonymous):

In PS1 Problem 2 I am having trouble using log in python. I entered from math import * at the top of my code then i only have print log(2) for the rest. It is giving me the number 0.69314718056 which i believe to be incorrect. I believe the correct answer to be 0.301029996. Why am I not getting this answer?

OpenStudy (anonymous):

tl;dr Python is telling me the log of 2 is 0.69314718056

OpenStudy (anonymous):

My calculator says the log of 2 is 0.301029996

OpenStudy (lucifer):

no, it's correct. log means log base e unless you specify. 0.30... is for base 10!

OpenStudy (anonymous):

ty for your reply

OpenStudy (anonymous):

the docs are your friend F1 from IDLE in windows http://docs.python.org/library/math.html#math.log

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!