1d = {'key':'value'}
2print(d)
3# {'key': 'value'}
4d['mynewkey'] = 'mynewvalue'
5print(d)
6# {'mynewkey': 'mynewvalue', 'key': 'value'}
7
1dict_1 = {"1":"a", "2":"b", "3":"c"}
2dict_2 = {"4":"d", "5":"e", "6":"f"}
3
4dict_1.update(dict_2)
5print(dict_1)
6#Output = {"1":"a", "2":"b", "3":"c", "4":"d", "5":"e", "6":"f"}
1default_data = {'item1': 1,
2 'item2': 2,
3 }
4
5default_data.update({'item3': 3})
6# or
7default_data['item3'] = 3
1mydict = {'score1': 41,'score2': 23}
2mydict['score3'] = 45 # using dict[key] = value
3print(mydict)
1# This automatically creates a new element where
2# Your key = key, The value you want to input = value
3dictionary_name[key] = value