Brand new to python, Let's say I have a dict:
kidshair = {'allkids':{'child1':{'hair':'blonde'},
'child2':{'hair':'black'},
'child3':{'hair':'red'},
'child4':{'hair':'brown'}}}
If child3 changes their hair colour regularly, I might want to write an application to speed up the data maintenance. In this example i'd use:
kidshair['allkids']['child3']['hair'] = ...
Is there any way to store this path as a variable so I can access it at my leasure? Obviously
mypath = kidshair['allkids']['child3']['hair']
results in mypath = 'red'. Is there any possible way to hard code the path itself so I could use:
mypath = 'blue'
to reperesent
kidshair['allkids']['child3']['hair'] = 'blue'
Kind thanks, ATfPT