Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursive solution in Clear category for The Flat Dictionary by MrPod
def flatten(dictionary):
d={}
for k,v in dictionary.items():
if type(v)==dict:
dd=flatten(v)
if not dd:
d[k]=''
for i,j in dd.items():
d[f'{k}/{i}']=j
else:
d[k]=v
return d
March 7, 2020