[Solved] Python. Converting string into directory [closed]


This is a very weird way to handle data.

I would use a nested dicts:

exampleDictionary = {'thing on ground': {'backpack': {'tea': 'Earl Grey'}}}

print exampleDictionary['thing on ground']
print exampleDictionary['thing on ground']['backpack']
print exampleDictionary['thing on ground']['backpack']['tea']

Outputs:

{'backpack': {'tea': 'Earl Grey'}}
{'tea': 'Earl Grey'}
Earl Grey

2

solved Python. Converting string into directory [closed]