Feb-21-2018, 11:13 AM
Hi,
Can someone please explain to me why when I enter this in python it does not give an error:
but as soon as I enter this it gives an error saying 'unhashable type'.
I understand lists are unhashable and arguments for sets can only be of hashable types.
But in here
Can someone please explain to me why when I enter this in python it does not give an error:
print(set([1,2,3]))
but as soon as I enter this it gives an error saying 'unhashable type'.
print(set(([1,2,3],[4,5,6])))
I understand lists are unhashable and arguments for sets can only be of hashable types.
But in here
print(set([1,2,3]))
the argument the set is taking is also a list (i.e [1,2,3]) no? so it should also give an error too, right?