Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 10 Online
OpenStudy (anonymous):

I am getting an exact difference of 1, in my answer while I am using the ceiling function. Here's the code: import math a=0 b=0 c=0 def mult_add(a,b,c): z = a*b+c return z >>> mult_add(math.log(12,7), 2, math.ceil(276/19)) 16.55397881653925 I should be getting: 17.5539788165

OpenStudy (rsmith6559):

try typing directly into the interpreter: 276 / 19 and 276 / 19.0 Then run them both with math.ceil() Python does integer division by default.

OpenStudy (anonymous):

Thanks. That explains it.

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!