Steve wrote in message said:
Hi,
How can I create a list of a dictionary? (in other words, I need to
create an array of a dictionary). Please help!
Steve
I am unsure how to interpret "of a". Do you mean a list *from* a
dictionary" or a list *of* dictionaries? "Array of a dictionary" suggests
you mean "array of dictionaries".
dictarray = [{} for i in range(10)]
listfromdict = {}.items()
Note the subtle trap of using 'dictarray = [{}]*10' instead: this will
create only one dictionary, with ten references to it.
In any case, this is an *extremely* basic question. Have you gone through
the included tutorial yet?