# 统计字典或者json字符串的深度 def depth(x): if type(x) is dict and x: return 1 + max(depth(x[a]) for a in x) if type(x) is list and x: return 1 + max(depth(a) for a in x) return 0
# 统计字典或者json字符串的深度 def depth(x): if type(x) is dict and x: return 1 + max(depth(x[a]) for a in x) if type(x) is list and x: return 1 + max(depth(a) for a in x) return 0