is there anyway appending to dictionary?
list has this feature
a = []
a.append(1)
print a [1]
but dictionary can't
i wanna do like this thinga = {1, 2}
a.append(3, 4) -> This is just my idea :@
print a {1:2, 3:4}
so i try this feature likea = {1, 2}
a = dict(zip(a.keys().append(3), a.values().append(4))) but this make's error
because a.keys().append(3) makes 'None' (i can't understand this :( )
so i tryimport copy
a = dict(zip(copy.copy(a.keys()).append(3),
copy.copy(a.values()).append(4)))
and
a = dict(zip(copy.deepcopy(a.keys()).append(3),
copy.deepcopy(a.values()).append(4)))
but this make's error, too
why a.keys().append(3) makes 'None' ?
and is there anyway appending to dictionary?
any post will be appreciated :)