I have a text file that look something of the sort:
I built a dictionary modes where the keys are the modes.
code looks something like this:
for line in mode_def_file: if "**END_MODES**" in line: break k, v = line.strip().split('=') modes_dict[k] = v.split(',')
Now to build group dict since values are keys of group_dict or modes_dict
i would like group_dict[group2] = [1,2,3,4,5,3,6,8,a,t,5,6].
I can think of the straightforward approach but is there a quick clean and efficient way to implement this?