This is the dictionary
cars = {\'A\':{\'speed\':70,
\'color\':2},
\'B\':{\'speed\':60,
\'color\':3}}
Using this
Here is my solution to the problem. I think it's similar in approach, but a little simpler than some of the other answers. It also allows for an arbitrary number of sub-dictionaries and seems to work for any datatype (I even tested it on a dictionary which had functions as values):
def pprint(web, level):
for k,v in web.items():
if isinstance(v, dict):
print('\t'*level, f'{k}: ')
level += 1
pprint(v, level)
level -= 1
else:
print('\t'*level, k, ": ", v)