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.

https://docs.python.org

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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -