[Edu-sig] AP Calc with Jupyter

A. Jorge Garcia calcpage at aol.com
Fri Jun 16 12:31:29 EDT 2017


OK, so let me get this straight. 
If I'm using Python 3, then division with integers is more akin to the way it works with doubles in Java?

In Java,
2.0/3 = 3/2.0 = 2.0/3.0 = 0.666...
In Python 2,
2/3 = 0
In Python 3,
2/3 = 0.666...
Right?

What about "div" and "mod"?
In Java,
2/3 = 0
2%3 = 2
In Python 2,
2//3 = 0
2%3 = 2
Right?

And in Python 3, how do you get "div" and "mod" operations to work on integers?

TIA,
AJG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20170616/53d8e628/attachment.html>


More information about the Edu-sig mailing list