Re: [Tutor] about tree input

2018-04-23 Thread Zachary Ware
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 __

Re: [Tutor] about tree input

2018-04-23 Thread 劉權陞
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

Re: [Tutor] about tree input

2018-04-22 Thread 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, 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