Why python do not support element insertion in set? -
i want understand, internal design strategy that, can not allow element insertion in set. following link describe set implemented using dictionary,where every element of set key.
so,why not supporting similar operation update in dictionary.
yes can, look:
>>> a=set() >>> a.add(1) >>> {1} >>> a.update([2,3,4,5]) >>> {1, 2, 3, 4, 5} >>>
Comments
Post a Comment