dict add item python code example Example: dictionary append value python d = {1:2} d.update({2: 4}) print(d) # {1: 2, 2: 4}