接口返回json串解析

response = {"data": {"h1": 1, "h2": 2}, "h3": 3}
d1 = {}
def hh(d):
    for key, value in d.items():
        if type(value) == dict:
            d1[key] = value
            hh(value)
        d1[key] = value
{'data': {'h1': 1, 'h2': 2}, 'h1': 1, 'h2': 2, 'h3': 3}
原文地址:https://www.cnblogs.com/pengranxindong/p/11757412.html