how to add a value to a dictionary in python code example
Example 1: how to add an item to a dictionary in python
a_dictonary = {}
a_dictonary.update({"Key": "Value"})
Example 2: add value to dictionary python
dict[key] = value
Example 3: python dictoinary add value
student_scores = {'Simon': 45 }
print(student_scores)
# {'Simon': 45}
student_scores['Sara'] = 63
print(student_scores)
# {'Simon': 45, 'Sara': 63}