英文文件:
<a href="http://www.php.cn/wiki/739.html" target="_blank">hash</a>
#(object)Return the hash value of the object (if it has one). Hash values are integers. They are used to quickly compare dictionary keys during a dictionary lookup. Numeric values that compare equal have the same hash value (even if they are of different types, as is the case ##for## 1 and# 1.# .
# 1. 傳回
物件的雜湊值,用整數#表示。哈希值在字典中查找時,可用來快速比較鍵的值。 >>> hash('good good study')
1032709256
2. 相等的數值,即使型別不一致,計算的雜湊值是一樣的。
>>> 1.0 == 1 True >>> hash(1.0) >>> hash(1) >>> hash(1.0000)
以上是Python內建hash函數的詳細介紹的詳細內容。更多資訊請關注PHP中文網其他相關文章!