add value to list in dict python code example
Example 1: dictionary append value python
d = {1:2}
d.update({2: 4})
print(d) # {1: 2, 2: 4}
Example 2: python dictoinary add value
student_scores = {'Simon': 45 }
print(student_scores)
# {'Simon': 45}
student_scores['Sara'] = 63
print(student_scores)
# {'Simon': 45, 'Sara': 63}