Python Converting Two Lists into Dynamic Nested Dict then to JSON, possible? : I have to go through a list of "colors":

`list1 = ["red","green","other"]`

for each one I need to go through a list of possible matches for each one:

`list2 = ["cherries","rasperries","guava","apple","watermelon","grapes","banana"]`

if the criteria of the item of list2 is good, then I'd need to create a dict to then write the output to JSON file.






`for x in list1:`

  `print x`

  `for y in list2:`

    `if y == criteria:`

      `myDict = {'list1-item': 'fruit1':'apple'}`



my expected output would be something like:

`data = {'red': {'fruit1': 'cherries', 'fruit2': 'rasperries', 'fruit3': 'guava'},
          'green': {'fruit1': 'apple'},
          'other': {'fruit1': 'watermelon', 'fruit2': 'grapes', 'fruit3': 'banana'}}`




#writing to JSON
'with open("data_file.json", "w") as write_file:'
`    json.dump(data, write_file)`


not really familiar to build a dynamic dictionary as need, any suggestion is appreciated.

