I have a dictionary that has dictionaries inside. I'm trying to access all the values in the keys inside. So I have:
d = {'key': 1, 'next': {'key': 5, 'next': {'key': 6, 'next': None}}}
And I'm hoping to get all the values of "key", so if all went well, I'd get:
1 5 6 None
I thought a basic loop would do the job, something like this:
for i in d:
print(d['key'])
but I keep getting:
1
1
How to I go about getting all the values in the dictionary?
Thanks for the help!