Tell me about how you would flatten a nested dictionary structure into a flat list format like a: 1, b: c: 2, b: d: 3.
Implement flatten_dict(data) to return one string for each leaf value, preserving dictionary insertion order. Nested keys must be joined with : , and empty dictionaries produce no output.
Input is a dictionary whose values are either scalar values or dictionaries. Output is a list of strings such as ["a: 1", "b: c: 2", "b: d: 3"].
: between path componentsdef flatten_dict(data):