I have a nested dict: d = { 'A': {'X': 0, 'Y': 1, 'Z': 2}, 'B': {'X': 0, 'Y': 1, 'Z': 2}, 'C': {'X': 0, 'Y': 1, 'Z': 2} } I'd now like to embed its values in a string using format, something like "d['A']['X']={A,X:d}".format(**d) to output: "d['A']['X']=0" How to do this correctly? Continue reading...