how to add multiple values to a dictionary key in python code example Example: dictionary multiple values per key key = "somekey" a.setdefault(key, []) a[key].append(1)