We know in Python, a set can be defined by writing out all its elements like this:
a_set={1,"xyz"}
And books of Python all say elements of a set can be any datatype. So we should be able to write out a set containing a set. I tried to write it as:
a_set={1,{"xyz"}}
But IDLE reported an error:
Traceback (most recent call last):
File "<pyshell#58>", line 1, in <module>
a_set={1,{"xyz"}}
TypeError: unhashable type: 'set'
I think this may be because Python is trying to understand it as a dictionary. Then, how to write out a set containing a set in Python?