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.
Thanks a million for the shout out, I'll link back to this video, from my website. Just watched your video, great explanation 👍 👍
Thanks! You definitely are more advanced with Python than I am, but if there's anytime you need my help, please let me know!
@@BrandonJacobson Right linked to your channel and video in my blog post above!
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.
Dat thumbnail tho
I know right!!!