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

Am working on ex. 2.3 from hw2.pdf. I'm trying to use math.ceil(276/19) but it returns 14 not 15. I'm running Python 2.7.2. I thought math.ceil() was supposed to round floats up not down.

OpenStudy (rsmith6559):

Floats yes, you're giving it an integer. If given two integers in division, Python will do integer division. If one or both of the numbers is a float, you'll get what you're expecting.

OpenStudy (anonymous):

Thanks for the info. Sometimes it's just sitting in front of your face. I even read the Python docs on it and it still didn't click. Thanks again.

OpenStudy (rsmith6559):

You're welcome.

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!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
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!