On Tue, Aug 11, 2009 at 8:17 PM, Krishna Pacifici<pacifi...@warnell.uga.edu> wrote: > Nevermind, > got it. > > Sorry. > >>>> Krishna Pacifici 08/11/09 2:12 PM >>> > Hi, > I want to append the values of a dictionary to a list. I have a dictionary > sec_dict_clean and I want to append the values to a list, but am having a > hard time looping through the values in the dictionary. > > I have tried something like this: > lista=[] > for i in sec_dict_clean.values(): > for j in sec_dict_clean.values()[i]: > lista.append(sec_dict_clean.values()[i]) > > But I keep on getting an error: > TypeError: list indices must be integers > > Any ideas on how to loop through values in a dictionary?
lista=[] for value in sec_dict_clean.values(): lista.append(value) but even simpler would be: lista = sec_dict_clean.values() -- André Engels, andreeng...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list