Are all hashable data types in python with unique elements? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Are all hashable data types in python with unique elements?

I am trying to mark out the difference between various data types to determine which one uses hash values at the backend. Please clarify. Thanks.

29th Mar 2022, 7:39 AM
Ruchika Sehgal
Ruchika Sehgal - avatar
1 Answer
+ 1
Hashable data types: int, float, str, tuple, and NoneType. Unhashable data types: dict, list, and set. Unhashable data types are all mutable in nature, while these five hashable data types are all immutable references : hope it helps.. .. https://betterprogramming.pub/3-essential-questions-about-hashable-in-JUMP_LINK__&&__python__&&__JUMP_LINK-33e981042bcb https://realpython.com/lessons/immutable-vs-hashable/#t=23.7 https://www.geeksforgeeks.org/why-and-how-are-python-functions-hashable/amp/
4th Apr 2022, 12:20 PM
Jayakrishna 🇮🇳