Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

in python, why does ratio= a/b print ratio ---this part and print a/b give different results?

OpenStudy (e.mccormick):

What version of Python are you using?

ganeshie8 (ganeshie8):

``` >>> ratio = 10/5 >>> print ratio 2 >>> print 10/5 2 ```

ganeshie8 (ganeshie8):

for me both are giving same output

OpenStudy (anonymous):

iim using python2.54 and i was referring to things like 2/3

OpenStudy (e.mccormick):

In 2.54, both of those should print 0.

OpenStudy (e.mccormick):

If they are 2/3 that is.

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!