how to create a nested dictionary from a list in python?,"from functools import reduce