On 11/11/05, Eric Walker <[EMAIL PROTECTED]> wrote: > All, > I have a dictionary say: > d = {'first':[]} > I am going through another list and depending on whats going on, > I want to add to the empty list. I have tried the following to noavail. > > d['first'] = d['first'].append("string") > > I would think this would result in the dictionary key first's empty list to > become ["string"]. can anyone help clear my head? > > Thanks...
I guess d['first'].append("string"), instead of, d['first'] = d['first'].append("string") or you will make d['first'] NoneType _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor