14.3 Add Dictionary Items
Adding Items Adding an item to the dictionary is done by using a new index key and assigning a value to it: Example thisdict = { “brand”: “Ford”, “model”: “Mustang”, “year”: 1964}thisdict[“color”] = “red”print(thisdict) Output:{‘brand’: ‘Ford’, ‘model’: ‘Mustang’, ‘year’: 1964, ‘color’: ‘red’} Update Dictionary The update() method will update the dictionary with the items from a given argument. If the item does not exist, the… Read More »