求一个嵌套列表的深度
def depth_count(data, max_depth=0):
if not data or not isinstance(data, list):
return max_depth
l = depth_count(data[0], max_depth + 1)
r = depth_count(data[1:], max_depth)
return max(l, r)
if __name__ == '__main__':
datas = [1, [22, [33, 44, [66], 77]]]
print(depth_count(datas))