On Mon, Apr 23, 2018 at 11:28 AM, 劉權陞 <01patrick...@gmail.com> wrote:
> I still have no idea about how to write the code. Can you make a
> demonstration?
Something like this:
def set(tree, path, key, value):
for p in path:
tree = tree[p]
tree[key] = value
--
Zach
__
I still have no idea about how to write the code. Can you make a
demonstration?
2018-04-23 0:42 GMT+08:00 Zachary Ware :
> Basically what you want to do here is give Tree a local name (d), loop
> through T reassigning d to d[k_from_T], and then d[k] = v after the loop. T
> can be arbitraily long
Basically what you want to do here is give Tree a local name (d), loop
through T reassigning d to d[k_from_T], and then d[k] = v after the loop. T
can be arbitraily long, and Tree can actually be and contain any indexable
type.
If this pointer isn't enough to send you in the right direction, I'll