Is it possible to hash lists?
For example, I know that hashes of tuples are possible:
>>> hash((1,2,3,4,5,6))
-319527650
But is it possible to hash a list?
>>> hash([1,2,3,4,5,6])
hash_value
Possible Solution:
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just try it:
So you can get
hashoftupleandfrozensetsince the are immutable, and you can’t do it forlistandsetbecause they are mutable.