In Python 3.9, I have a list of dictionaries: variables = [ {'id': ['alpha'], 'ip': '10.10.10.10', 'name': 'primary'}, {'id': ['beta', 'gamma'], 'ip': '10.10.10.20', 'name': 'secondary'} ] My goal is to transform it into this dictionary format: result = { 'alpha.ip': '10.10.10.10', 'alpha.name': 'primary', 'beta.ip': '10.10.10.20', 'beta.name': 'secondary', 'gamma.ip': '10.10.10.20', 'gamma.name': 'secondary' } I have a difficult time drafting the id loop logic, which will produce the correct result. Continue reading...