小编Sol*_*aji的帖子

在Python中使用Hashing元组会在不同的系统中导致不同的结果

我正在练习元组哈希.在那里,我正在研究Python 2.7.以下是代码:

num = int(raw_input())
num_list = [int(x) for x in raw_input().split()]
print(hash(tuple(num_list)))
Run Code Online (Sandbox Code Playgroud)

上面的代码导致了

>>> 2
>>> 1 2
>>> 3713081631934410656
Run Code Online (Sandbox Code Playgroud)

但在我使用Python 3.4的本地PC上,答案是

>>> 1299869600
Run Code Online (Sandbox Code Playgroud)

代码被接受但我无法找出导致不同结果的原因.这是针对不同版本的Python吗?

python hash

5
推荐指数
1
解决办法
650
查看次数

标签 统计

hash ×1

python ×1