I am trying to create dict by nested list:
dict
list
groups = [[\'Group1\', \'A\', \'B\'], [\'Group2\', \'C\', \'D\']] L = [{y:x[0] for y in x i
I think one line solution is a bit confusion. I would write code like below
groups = [['Group1', 'A', 'B'], ['Group2', 'C', 'D']] result = {} for group in groups: for item in group[1:]: result[item] = group[0] print result