开满天机
貌似Python标准库并没提供对树的操作,这是基本的数据结构操作,用递归很容易实现:def tree_find(tree, value):def tree_rec(tree, iseq):if isinstance(tree, list):for i, child in enumerate(tree):r = tree_rec(child, iseq + [i])if r is not None:return relif tree == value:return iseqelse:return None