0
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
Dean Christian Armada
  • 6,724
  • 9
  • 67
  • 116

0 Answers0