Home > Article > Backend Development > Detailed introduction to Python's built-in hash function
English document:
##hash<a href="http://www.php.cn/wiki/739.html" target="_blank"></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.0) .
Instructions:
1. Return the hash value ofobject, using integer express. Hash values can be used to quickly compare key values during dictionary lookups.
>>> hash('good good study') 10327092562. For equal values, even if the types are inconsistent, the calculated hash value is the same.
>>> 1.0 == 1 True >>> hash(1.0) >>> hash(1) >>> hash(1.0000)
The above is the detailed content of Detailed introduction to Python's built-in hash function. For more information, please follow other related articles on the PHP Chinese website!