You almost have it. Do this instead. d = {'first':[]} d['first'].append("string")
Append acts on the list, so assignment is unnecessary. ds Eric Walker 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... > >_______________________________________________ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor > > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor