Python hash() Function
Description
hash() Used to obtain the hash value of an object (a string, number, etc.).
Syntax
hash syntax:
hash(object)
Parameter Description:
- object -- the object;
Return Value
Returns the hash value of the object.
Example
The following examples demonstrate how to use hash:
hash
(
'
test
'
)
String
2314058222102390712
hash
(
1
)
Digit
1
hash
(
str
(
[
1
,
2
,
3
]
)
)
Union
1335416675971793195
hash
(
str
(
sorted
(
{
'
1
'
:
1
}
)
)
)
Dictionaries
7666464346782421378
Python built-in function