Write a python function to combine three lists of equal lengths into a nested dictionary and return it


Topic: Write a python function to combine three lists of equal lengths into a nested dictionary and return it

Solution

def lists_to_dict(test_list1, test_list2, test_list3):
  res = [{a: {b: c}} for (a, b, c) in zip(test_list1, test_list2, test_list3)] 
  return res



List all Python Programs