First iterating over the outer values using key_level1 and val_level1, then iterating over inner values using key_level2, val_level2:
for key_level1, val_level1 in r.items():
for key_level2, val_level2 in val_level1.items():
for val in val_level2.split(','):
# Example:
# do something
print(key_level1, key_level2, val)
4
solved Python iterate over multi value nested dictionary [closed]