I have a multidimensional dictionary to which I am unable to add a new element. Can you please help with this query :
items = {'Warner': {'balls': 4, 'runs': 6},
'Dhawan': {'balls': 2, 'runs': 0},
'yuvaraj': {'balls': 1.5, 'runs': 32},
'scouts': {'balls': 3, 'runs': 15}
}
to this, I want to add a new element
items['varun'] = [{'balls': 2}, {'runs': 2}]
However, the above line throws an error saying key error Varun.