Python hash() function
Published February 16, 2022The hash() function in Python is a built-in function that returns an object's hash value. A hash value can be defined as the integer that can be used to quickly compare the dictionary keys when looking at the dictionary. Hash() produces irreversible hashed objects, which might result in data loss.
Syntax
The hash() function has the following syntax:
hash(object to convert into hash) |
Example of how hash() works
var = ('P','Y','T','H','O','N') print(hash(var)) |
Output
![]() |
Article Contributed By :
|
|
|
|
257 Views |