0

I would like to get and set values in a dictionary using a list of keys.

I would like to be able to use a list of keys like this

lis = ["key1", "key2", "key3"]

to effectively do something like this

dict["key1"]["key2"]["key3"] = "value"

or this

value = dict["key1"]["key2"]["key3"]

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
TheAmazingJeh
  • 37
  • 1
  • 3

0 Answers0