摘要: 习题:将source字典扁平化,输出为 target 格式的字典。source = {'a': {'b': 1, 'c': 2}, 'd': {'e': 3, 'f': {'g': 4}}}target = {'a.b': 1, 'd.f.g': 4, 'd.e': 3, 'a.c': 2}def func(src, targetkey='' ): for k, v in src.items... 阅读全文
posted @ 2018-01-25 21:23 YONG.MAX 阅读(766) 评论(0) 推荐(0) 编辑