x = {'name': {'first': 'dean'}}
On the example above, I am aware that x['name']['first']
will get the value dean
. But can we assign ['name']['first']
into a variable? Something like:
x = {'name': {'first': 'dean'}}
y = ['name']['first']
x[y] // this will output to dean