On Fri, Jan 3, 2014 at 4:50 AM, Danny Yoo <d...@hashcollision.org> wrote:
> Quick thing. Please look at the following small program: > > ################# > d1 = {1 : 'one'} > d2 = d1 > d2[2] = 'two' > print(d1) > print(d2) > ################# > > Predict what this prints out. Write your prediction on a piece of paper. > > Then run the program. Does it match what you wrote? > > If not, start asking questions. If so, then I'm puzzled. :P > > > Thanks Danny: I understand this issue when I'm looking right at it, but it can still slip past me with a moments inattention... as soon as you pointed it out, I bruised my forehead by slapping it so hard. Thanks. Actually, it's funnier than that: I now notice that the code I swiped from you passes the original arrays, not even the "copies" which aren't copies. That's what I meant to do: make a copy when I wrote chute_nums = chutes. So I should have passed chute_nums to summarize_game, but it still wouldn't work (because it's not a copy). More below.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor