Creating nested dictionary based on the checks done on another nested dictionaries python

join shbcf.ru