add elements in dictionary python code example
Example 1: add value to dictionary python
dict[key] = value
Example 2: add values to dictionary key python
key = "somekey"
a.setdefault(key, [])
a[key].append(2)
Example 3: how to append in dictionary in python
my_dict = {"Name":[],"Address":[],"Age":[]};
my_dict["Name"].append("Guru")
my_dict["Address"].append("Mumbai")
my_dict["Age"].append(30)
print(my_dict)