How to raise error if user tries to enter duplicate entries in a set in Python?
<p>I tried to enter 5 similar elements in a set and print it at last. It took all the elements without raising any error but stored only one since all were same. I want to know if it is possible that the moment i input a value which is already present in the set , user is prompted with an error that the value already present in the set. I want to do this with set only , not with list or dict on anything else.</p>