Python: Building list of lists using dictionary recursion

visit shbcf.ru