CoCalc -- Collaborative Calculation in the Cloud
Sharedsupport / 2017-06-12-hash.ipynbOpen in CoCalc

Examples for support purposes...

a = Mod(1,3)
b = 4
a == b
True
hash(a), hash(b)
(1, 4)
v = {a:5}
v[b]
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-25-a2ac5d31cc70> in <module>() 1 v = {a:Integer(5)} ----> 2 v[b] KeyError: 4
v[2**65-1]
5
a == 4, a == 2**65-1
(True, True)
v.keys()[0] == b
True
set([hash(a), hash(b)])
{1, 4}
hash(2**65-1)
1