text: Q:
  
  How can I get values from list of dictionary in a format
  
  I have a list of dictionaries in which the values are in the list :
  list_of_dict = [
    {'Node': '1', 'IdRackIp': ['Id1','Id2']},
    {'Node': '2', 'IdRackIp': ['Id3','Id4']}
  ]
  
  I want to get a new list of dictionary in a particular format -
  list_of_dict =[
    {'Node': '1', 'IdRackIp': 'Id1'},
    {'Node': '1', 'IdRackIp': 'Id2'},
    {'Node': '2', 'IdRackIp': 'Id3'},
    {'Node': '2', 'IdRackIp': 'Id4'}
  ]
  
  I have recently started working on Python and I am getting trouble to sort it in this format. Can anyone help me to get this format?
  
  A:
  
  Fundamentally what you're looking for is:
  dicts = []
  for d in list_of_dicts:
      for i in d['IdRackIp']:
          dicts.append({'Node': d['Node'], 'IdRackIp': i})
  
  This can be compacted using a list comprehension:
  dicts = [{'Node': d['Node'], 'IdRackIp': i} for d in list_of_dicts for i in d['IdRackIp']]
  
  The repetitive dictionary notation can further be compacted to: 
  dicts = [dict(d, IdRackIp=i) for d in list_of_dicts for i in d['IdRackIp']]
  
  Credits for this last one entirely go to Mezba メ, who remembered it first; but I thought it important to incorporate here too.
  
  