Hashable : int , float , str , tuple , and Booleans Unhashable : set,list and dict Guys, if this video is useful, Please make sure to like or comment this video to continue this Error Solving playlist ( ruclips.net/video/VYecxRO9oaI/видео.html ).Your support is must.
A = set() #Empty Set element = (5, 6, [ "Apple" ]) A.add(element) TYPEERROR : unhashable type list. The reason is tuple is immutable but in our case tuple element variable is not immutable. We can access element[2] and then element[2].append("banana") So when we are adding this the list inside tuple cannot be a hashable.
Hashable : int , float , str , tuple , and Booleans
Unhashable : set,list and dict
Guys, if this video is useful, Please make sure to like or comment this video to continue this Error Solving playlist ( ruclips.net/video/VYecxRO9oaI/видео.html ).Your support is must.
A = set() #Empty Set
element = (5, 6, [ "Apple" ])
A.add(element)
TYPEERROR : unhashable type list.
The reason is tuple is immutable but in our case tuple element variable is not immutable.
We can access element[2] and then element[2].append("banana")
So when we are adding this the list inside tuple cannot be a hashable.
Nice, continue
thank you very much😍
👏
thanks🤗