When I try to initialize a set using the following statement:
myset = {['ki','ni']}
I am presented with the following error:
TypeError: unhashable type: 'list'
However, I can initialize the set with the same list with the set() function as follows:
myset = set(['ki','ni'])
I understand that the elements of a set have to be immutable and hence the error that I have specified in the first case, could be just due to that. What is confusing is that, why does this work when the set() function is used and not when directly initializing a set using the curly ({}) braces?