def recursion(my_dict):
for x, y in my_dict.items():
if isinstance(y, dict):
recursion(y)
else:
print(y)
isinstance() checks if first argument is of type specified in the second argument, in this case it checks if y is of type 'dict', if it is then continue with the recursion, or else print it.