You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be avoided, because Python's semantic does not guarantee that '1 is 1'. In fact, in the CPython implementation, this is only True for integers lower or equal to 256:
>>> a = 257
>>> b = 257
>>> a is b
False
>>> a = 256
>>> b = 256
>>> a is b
True
The text was updated successfully, but these errors were encountered:
I realised 'is' was still in place. So I checked above issue, having no problem with higher numbers, unless I assigned numbers using a = 257 and b =257, which the notebook doesn't do (maybe it did before).
Adding this comment for benefit of others... Anyone interested in the reasons can find why on stackoverflow.
Hi,
In this notebook: https://github.com/mikkokotila/jupyter4kids/blob/master/notebooks/numerical-computing-is-fun-2.ipynb you use the 'is' keyword to compare numbers.
This should be avoided, because Python's semantic does not guarantee that '1 is 1'. In fact, in the CPython implementation, this is only True for integers lower or equal to 256:
The text was updated successfully, but these errors were encountered: