I have a nested dict:
KEYS1 = ("A", "B", "C")
KEYS2 = ("X", "Y", "Z")
d = dict.fromkeys(KEYS1, dict.fromkeys(KEYS2, 0))
Now I would like to embed its values in a string using a format, something like
print("d['A']['X']={A,X:d}".format(**d))
for output:
d['A']['X']=0
This does not work. Any suggestions on how to do this correctly?
source
share