I have the following code :
set_a.remove(4) # error here
It produces the following error message :
KeyError : 4
If I modify the code as :
The output is
ValueError : list.remove(x) : x not in list
Why does the Python interpreter provides KeyError in the case of sets instead of ValueError as in the case of lists?
Keys are associated with dicts therefore are sets linked with dicts?
Or are set members called as keys? If so the reason for that please.