This is the dictionary
cars = {\'A\':{\'speed\':70, \'color\':2}, \'B\':{\'speed\':60, \'color\':3}}
Using this
I prefer the clean formatting of yaml:
yaml
import yaml yaml.dump(cars)
output:
A: color: 2 speed: 70 B: color: 3 speed: 60