I want to define a nested dictionary in python. I tried the following:
keyword = 'MyTest' # Later I want to pull this iterating through a list
key = 'test1'
sections = dict(keyword={}) #This is clearly wrong but how do I get the string representation?
sections[keyword][key] = 'Some value'
I can do this:
sections = {}
sections[keyword] = {}
But then there is a warning in the Pycharm saying it can be defined through dictionary label.
Can someone point out how to achieve this?
sections = {keyword: {}}?