hash()
Built-in FunctionPython 2.0+Intermediate
Returns the hash value of an object (used in dicts and sets)
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
print(hash(42)) print(hash("hello")) print(hash((1, 2, 3)))
hash() is a built-in function that returns the hash value of an object (used in dicts and sets).
Try in PlaygroundTags
builtinfunctioncorehashingdictset