Re: AP Calc with Jupyter

Wes Turner <[email protected]>
Newsgroups gmane.comp.python.education
Message-ID <CACfEFw-P+TFdmRtdJiCRUkj7_e=9Tv1eeZdKNUzkgK+LLrtsJg@mail.gmail.com>
On Friday, June 16, 2017, A. Jorge Garcia via Edu-sig <[email protected]>
wrote:

> 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?
>

There are a number of differences.
- https://westurner.github.io/wiki/awesome-python-testing#python-2-python-3
- https://github.com/nandoflorestan/nine/blob/master/nine/__init__.py
- http://www.informit.com/articles/printerfriendly/1328795

  from __future__ import division #py2

# https://www.python.org/dev/peps/pep-0238/ (2001)

... http://python-future.org/compatible_idioms.html



>
> TIA,
> AJG
>

_______________________________________________
Edu-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/edu-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.